Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
east-10
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
east-10
Commits
c1bcece7
Commit
c1bcece7
authored
Jun 29, 2021
by
linzhiguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 图片选项与文字选项混排重叠
parent
4317d267
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
18 deletions
+49
-18
east-10.fire
play/assets/east-10/scene/east-10.fire
+5
-5
east-10.js
play/assets/east-10/scene/east-10.js
+41
-12
option.js
play/assets/east-10/script/option.js
+3
-1
No files found.
play/assets/east-10/scene/east-10.fire
View file @
c1bcece7
...
...
@@ -556,7 +556,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 5
4
0
"height": 5
3
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -568,7 +568,7 @@
"ctor": "Float64Array",
"array": [
-640,
1
17
,
1
21.50000000000003
,
0,
0,
0,
...
...
@@ -660,11 +660,11 @@
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 4
5
,
"_alignFlags": 4
1
,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 18
0
,
"_bottom": 18
5.5
,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
...
...
@@ -673,7 +673,7 @@
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 12
77
,
"_originalWidth": 12
80
,
"_originalHeight": 530,
"_id": "70gNgjcRhGR75pT/PBUfxW"
},
...
...
play/assets/east-10/scene/east-10.js
View file @
c1bcece7
...
...
@@ -204,16 +204,17 @@ cc.Class({
}
console
.
log
(
this
.
data
);
this
.
_speed
=
Math
.
max
(
2
,
2
/
1280
*
this
.
_frameSize
.
width
);
this
.
_test
=
cc
.
find
(
'
Canvas/test
'
);
this
.
_move_area
=
cc
.
find
(
'
Canvas/move_area
'
);
this
.
_kind_group
=
cc
.
find
(
'
Canvas/fg/kind
'
).
getComponent
(
cc
.
js
.
getClassByName
(
'
KindGroup
'
));
this
.
_move_area
.
height
=
this
.
_frameSize
.
height
-
260
;
let
h1
=
this
.
_frameSize
.
height
-
260
-
216
*
2
;
let
s1
=
h1
/
3
;
let
offy
=
216
/
2
;
let
offy
=
216
/
2
;
this
.
_ys
=
[
-
offy
,
offy
];
// let option_node = cc.find('res/option');
...
...
@@ -333,7 +334,7 @@ cc.Class({
// })
// .start();
this
.
_xs
[
i
%
2
]
+=
selected
.
target
.
_w
;
//
this._xs[i%2] += selected.target._w;
selected
.
target
.
removeFromParent
();
selected
.
target
=
null
;
...
...
@@ -699,19 +700,47 @@ cc.Class({
if
(
!
this
.
_moved
)
return
;
let
speed
=
2
;
let
speed
=
this
.
_speed
;
let
area
=
this
.
_move_area
;
this
.
_xs
[
0
]
+=
speed
;
this
.
_xs
[
1
]
+=
speed
;
for
(
let
i
=
0
;
i
<
area
.
childrenCount
;
i
++
){
let
item
=
area
.
children
[
i
];
// this._xs[0] += speed;
// this._xs[1] += speed;
let
item
,
len
=
area
.
childrenCount
;
for
(
let
i
=
0
;
i
<
len
;
i
++
){
item
=
area
.
children
[
i
];
item
.
x
+=
speed
;
if
(
item
.
x
>
this
.
_frameSize
.
width
+
item
.
_w
){
this
.
_xs
[
i
%
2
]
-=
item
.
_w
;
item
.
x
=
Math
.
min
(
-
item
.
_w
/
2
,
this
.
_xs
[
i
%
2
]);
if
(
item
.
x
-
item
.
_w
/
2
+
item
.
_xoff
>
area
.
width
){
//
this._xs[i%2] -= item._w;
//
item.x = Math.min(-item._w/2, this._xs[i%2]);
//item.x = -item._w/2;
item
.
x
=
Math
.
min
(
-
item
.
_w
/
2
,
this
.
getLastX
(
i
));
}
}
},
getLastX
(
idx
){
let
row
=
idx
%
2
;
let
area
=
this
.
_move_area
;
let
obj
=
area
.
children
[
idx
];
let
mx
=
obj
.
x
,
mi
=
-
1
;
let
item
,
len
=
area
.
childrenCount
;
for
(
let
i
=
row
;
i
<
len
;
i
+=
(
row
+
1
)){
item
=
area
.
children
[
i
];
if
(
mx
>
item
.
x
){
mx
=
item
.
x
;
mi
=
i
;
}
}
let
ret
=
0
;
if
(
mi
>=
0
){
ret
=
mx
-
obj
.
_w
/
2
-
area
.
children
[
mi
].
_w
/
2
;
}
console
.
log
(
ret
);
return
ret
;
}
});
play/assets/east-10/script/option.js
View file @
c1bcece7
...
...
@@ -54,7 +54,7 @@ cc.Class({
this
.
word_node
.
active
=
type
==
1
;
this
.
word
.
node
.
active
=
type
==
1
;
this
.
word_finish
.
active
=
false
;
this
.
node
.
_w
=
[
3
45
,
420
][
type
];
this
.
node
.
_w
=
[
3
60
,
420
][
type
];
this
.
resetWH
();
this
.
changeBackground
();
},
...
...
@@ -67,12 +67,14 @@ cc.Class({
this
.
node
.
height
=
this
.
pic_node
.
height
;
this
.
pic
.
width
=
this
.
node
.
width
;
this
.
pic
.
height
=
this
.
node
.
height
;
this
.
node
.
_xoff
=
this
.
pic_node
.
x
;
}
else
if
(
this
.
_type
==
1
){
this
.
node
.
width
=
this
.
word_node
.
width
;
this
.
node
.
height
=
this
.
word_node
.
height
;
// this.word.node.x = -this.word_node.x;
// this.word.node.y = -this.word_node.y;
this
.
node
.
_xoff
=
this
.
word_node
.
x
;
}
},
...
...
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