Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-libs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-libs
Commits
eeb207d3
Commit
eeb207d3
authored
Jun 03, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
8522633d
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
292 deletions
+33
-292
.DS_Store
dist/.DS_Store
+0
-0
pictures.json
dist/customs/pictures.json
+11
-1
main.js
src/custom/pictures/debug/main.js
+1
-285
main.js.map
src/custom/pictures/debug/main.js.map
+1
-1
meta.json
src/custom/pictures/meta.json
+10
-0
GameView.ts
src/custom/pictures/src/game/GameView.ts
+10
-5
No files found.
dist/.DS_Store
View file @
eeb207d3
No preview for this file type
dist/customs/pictures.json
View file @
eeb207d3
This diff is collapsed.
Click to expand it.
src/custom/pictures/debug/main.js
View file @
eeb207d3
This diff is collapsed.
Click to expand it.
src/custom/pictures/debug/main.js.map
View file @
eeb207d3
This diff is collapsed.
Click to expand it.
src/custom/pictures/meta.json
View file @
eeb207d3
...
...
@@ -22,6 +22,16 @@
"type"
:
"number"
,
"default"
:
827
},
"OFFSET_X"
:
{
"alias"
:
"OFFSET_X"
,
"type"
:
"number"
,
"default"
:
0
},
"OFFSET_Y"
:
{
"alias"
:
"OFFSET_Y"
,
"type"
:
"number"
,
"default"
:
0
},
"GAP"
:
{
"alias"
:
"图片间隙"
,
"type"
:
"number"
,
...
...
src/custom/pictures/src/game/GameView.ts
View file @
eeb207d3
...
...
@@ -7,6 +7,8 @@ import qietu from "./qietu";
import
{
getIndexFromRC
,
getRandomArray
,
getTextureByName
}
from
"./utils"
;
import
ObjectPool
=
engine
.
ObjectPool
;
let
OFFSET_X
;
let
OFFSET_Y
;
let
MAX_COL
;
let
MAX_ROW
;
let
W
;
...
...
@@ -144,6 +146,8 @@ export default class GameView extends engine.Container {
MAX_COL
=
props
.
MAX_COL
;
MAX_ROW
=
props
.
MAX_ROW
;
GAME_TIME
=
props
.
GAME_TIME
;
OFFSET_X
=
props
.
OFFSET_X
;
OFFSET_Y
=
props
.
OFFSET_Y
;
W
=
props
.
W
;
H
=
props
.
H
;
GAP
=
props
.
GAP
;
...
...
@@ -157,9 +161,9 @@ export default class GameView extends engine.Container {
const
parent
=
new
engine
.
Sprite
();
this
.
picturesWrapper
=
parent
;
this
.
addChild
(
parent
);
const
OFFSET
=
(
750
-
props
.
W
)
/
2
this
.
picturesWrapper
.
x
=
OFFSET
;
this
.
picturesWrapper
.
y
=
(
this
.
stage
.
height
-
props
.
H
)
/
2
;
// this.picturesWrapper.x = OFFSET_X
;
// this.picturesWrapper.y = OFFSET_Y
;
// 添加按钮
// const btn = new engine.Rect();
...
...
@@ -310,8 +314,9 @@ export default class GameView extends engine.Container {
onMove
(
e
:
engine
.
MouseEvent
)
{
// 当前图片的位置
this
.
dragPic
.
x
=
e
.
stageX
-
this
.
localPicX
;
this
.
dragPic
.
y
=
e
.
stageY
-
this
.
localPicY
;
this
.
dragPic
.
x
=
e
.
stageX
-
this
.
localPicX
-
OFFSET_X
;
this
.
dragPic
.
y
=
e
.
stageY
-
this
.
localPicY
-
(
1624
-
this
.
stage
.
height
)
/
2
-
(
1624
-
OFFSET_Y
)
/
2
;
console
.
log
(
'fuck on move'
,
OFFSET_Y
)
// console.log(this.dragPic.x, this.dragPic.y)
// 当前图片的中心位置
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment