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
769b4651
Commit
769b4651
authored
Jun 25, 2021
by
linzhiguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# layout 增加子项超宽引起外层node.size异常
# 改善选项命中
parent
c7976f06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
east-10.js
play/assets/east-10/scene/east-10.js
+9
-4
kind.js
play/assets/east-10/script/kind.js
+6
-0
No files found.
play/assets/east-10/scene/east-10.js
View file @
769b4651
...
@@ -227,7 +227,7 @@ cc.Class({
...
@@ -227,7 +227,7 @@ cc.Class({
cc
.
find
(
'
Canvas/show
'
).
on
(
'
click
'
,
()
=>
{
cc
.
find
(
'
Canvas/show
'
).
on
(
'
click
'
,
()
=>
{
let
item
=
cc
.
instantiate
(
this
.
_kind_group
.
template_node
);
let
item
=
cc
.
instantiate
(
this
.
_kind_group
.
template_node
);
this
.
_kind_group
.
node
.
addChild
(
item
);
this
.
_kind_group
.
node
.
addChild
(
item
);
item
.
y
=
43
;
item
.
y
=
80
;
this
.
_kind_group
.
updateView
();
this
.
_kind_group
.
updateView
();
});
});
...
@@ -296,7 +296,8 @@ cc.Class({
...
@@ -296,7 +296,8 @@ cc.Class({
return
;
return
;
let
item
,
len
=
this
.
_kind_group
.
node
.
childrenCount
;
let
item
,
len
=
this
.
_kind_group
.
node
.
childrenCount
;
for
(
let
i
=
0
;
i
<
len
;
i
++
){
let
i
=
0
;
for
(
i
=
0
;
i
<
len
;
i
++
){
item
=
this
.
_kind_group
.
node
.
children
[
i
];
item
=
this
.
_kind_group
.
node
.
children
[
i
];
if
(
cc
.
rect
(
item
.
getBoundingBoxToWorld
()).
intersects
(
cc
.
rect
(
selected
.
node
.
getBoundingBoxToWorld
()))){
if
(
cc
.
rect
(
item
.
getBoundingBoxToWorld
()).
intersects
(
cc
.
rect
(
selected
.
node
.
getBoundingBoxToWorld
()))){
console
.
log
(
i
);
console
.
log
(
i
);
...
@@ -305,8 +306,9 @@ cc.Class({
...
@@ -305,8 +306,9 @@ cc.Class({
let
kind
=
item
.
getComponent
(
cc
.
js
.
getClassByName
(
'
WordKind
'
));
let
kind
=
item
.
getComponent
(
cc
.
js
.
getClassByName
(
'
WordKind
'
));
if
(
kind
.
kind_id
!=
selected
.
kind_id
){
if
(
kind
.
kind_id
!=
selected
.
kind_id
){
this
.
playAudioByName
(
'
incorrect
'
);
//this.playAudioByName('incorrect');
break
;
//break;
continue
;
}
}
this
.
playAudioByName
(
'
correct
'
);
this
.
playAudioByName
(
'
correct
'
);
let
node
=
cc
.
instantiate
(
cc
.
find
(
'
res/option_item
'
));
let
node
=
cc
.
instantiate
(
cc
.
find
(
'
res/option_item
'
));
...
@@ -330,6 +332,9 @@ cc.Class({
...
@@ -330,6 +332,9 @@ cc.Class({
break
;
break
;
}
}
}
}
if
(
i
==
len
){
this
.
playAudioByName
(
'
incorrect
'
);
}
this
.
_moved
=
true
;
this
.
_moved
=
true
;
this
.
_touched
=
false
;
this
.
_touched
=
false
;
if
(
selected
.
target
){
if
(
selected
.
target
){
...
...
play/assets/east-10/script/kind.js
View file @
769b4651
...
@@ -128,6 +128,12 @@ cc.Class({
...
@@ -128,6 +128,12 @@ cc.Class({
node
.
width
*=
sr
;
node
.
width
*=
sr
;
node
.
height
*=
sr
;
node
.
height
*=
sr
;
node
.
scale
*=
sr
;
node
.
scale
*=
sr
;
if
(
node
.
width
>
this
.
node
.
width
-
50
){
sr
=
(
this
.
node
.
width
-
50
)
/
node
.
width
;
node
.
width
*=
sr
;
node
.
height
*=
sr
;
node
.
scale
*=
sr
;
}
// node.opacity = 0;
// node.opacity = 0;
option
.
adjustPicSize
();
option
.
adjustPicSize
();
cb
&&
cb
();
cb
&&
cb
();
...
...
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