Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP15
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
OP15
Commits
97b89194
Commit
97b89194
authored
Aug 02, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug
parent
81ff8b16
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
9 deletions
+50
-9
OP15.js
assets/OP15/scene/OP15.js
+50
-9
No files found.
assets/OP15/scene/OP15.js
View file @
97b89194
...
...
@@ -202,7 +202,6 @@ cc.Class({
console
.
log
(
'
[answer] thinking and playing
'
);
// check every second
const
id
=
setInterval
(()
=>
{
console
.
log
(
"
aaaaaa
"
);
if
(
!
this
.
_lastFingerPosition
.
dirty
)
{
return
;
}
...
...
@@ -217,7 +216,7 @@ cc.Class({
}
else
{
callback
(
'
WRONG
'
)
}
},
3
00
);
},
1
00
);
this
.
_intervalIds
.
push
(
id
);
// Perform cleanup
...
...
@@ -246,8 +245,20 @@ cc.Class({
const
an
=
context
.
questions
[
context
.
questionIndex
].
node
;
console
.
log
(
'
in right
'
+
(
typeof
an
))
an
.
active
=
true
;
const
dragonDisplay
=
an
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
'
normal
'
,
0
);
if
(
an
.
isSpine
)
{
const
skeleton
=
an
.
getComponent
(
sp
.
Skeleton
);
skeleton
.
setToSetupPose
();
setTimeout
(()
=>
{
skeleton
.
setAnimation
(
0
,
'
normal
'
,
true
);
},
1
);
}
else
{
const
dragonDisplay
=
an
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
dragonDisplay
.
playAnimation
(
'
normal
'
,
0
);
}
const
ddLogoCat
=
this
.
logoCat
.
getComponent
(
dragonBones
.
ArmatureDisplay
)
ddLogoCat
.
playAnimation
(
'
right
'
,
1
)
ddLogoCat
.
once
(
dragonBones
.
EventObject
.
COMPLETE
,
function
()
{
...
...
@@ -611,11 +622,14 @@ cc.Class({
},
checkInRegion
(
r
)
{
console
.
log
(
'
r~~~:
'
,
r
);
if
(
!
this
.
_lastFingerPosition
&&
!
this
.
_lastFingerPosition
.
pos
)
{
return
null
;
}
const
p
=
this
.
_lastFingerPosition
?
this
.
_lastFingerPosition
.
pos
||
{
x
:
0
,
y
:
0
}
:
{
x
:
0
,
y
:
0
};
console
.
log
(
'
~p:
'
,
p
);
console
.
log
(
'
~r:
'
,
r
);
const
w
=
p
.
x
>
r
.
x
&&
p
.
x
<
(
r
.
x
+
r
.
width
);
const
h
=
p
.
y
>
r
.
y
&&
p
.
y
<
(
r
.
y
+
r
.
height
);
return
w
&&
h
;
...
...
@@ -999,13 +1013,13 @@ cc.Class({
addRectNodeListener
(
data
)
{
const
bg
=
cc
.
find
(
`Canvas/frame-border/ground/bg`
);
const
bg
=
cc
.
find
(
`Canvas/frame-border/ground/bg`
)
.
parent
;
const
rate
=
(
bg
.
scale
*
bg
.
width
)
/
this
.
data
.
bgItem
.
rect
.
width
;
const
rectNode
=
new
cc
.
Node
();
rectNode
.
name
=
'
rect
'
+
data
.
index
;
bg
.
addChild
(
rectNode
);
bg
.
addChild
(
rectNode
,
20
);
const
ctx
=
rectNode
.
addComponent
(
cc
.
Graphics
);
...
...
@@ -1016,20 +1030,47 @@ cc.Class({
const
scale
=
rate
/
bg
.
scaleY
;
console
.
log
(
'
scale~ :
'
,
scale
)
rectNode
.
width
=
data
.
rect
.
width
*
scale
;
rectNode
.
height
=
data
.
rect
.
height
*
scale
;
rectNode
.
x
=
-
bg
.
width
/
2
+
data
.
rect
.
x
*
scale
;
rectNode
.
y
=
bg
.
height
/
2
-
data
.
rect
.
height
*
scale
-
data
.
rect
.
y
*
scale
;
rectNode
.
x
=
-
bg
.
width
/
2
+
data
.
rect
.
x
*
scale
+
bg
.
x
;
rectNode
.
y
=
bg
.
height
/
2
-
data
.
rect
.
height
*
scale
-
data
.
rect
.
y
*
scale
+
bg
.
y
;
rectNode
.
anchorX
=
rectNode
.
anchorY
=
0
;
console
.
log
(
'
data:
'
,
data
);
console
.
log
(
'
rectNode:
'
,
rectNode
);
// if (pageData.bgItem.isShowDebugLine) {
ctx
.
rect
(
0
,
0
,
rectNode
.
width
,
rectNode
.
height
);
// ctx.fillRect(0, 0, 200, 200);
// }
ctx
.
stroke
();
ctx
.
fill
();
rectNode
.
addComponent
(
cc
.
Button
);
rectNode
.
on
(
"
click
"
,
()
=>
{
console
.
log
(
"
in rectNode click
"
);
const
_x
=
rectNode
.
x
/
bg
.
width
;
const
_y
=
rectNode
.
y
/
bg
.
height
;
const
_w
=
rectNode
.
width
/
bg
.
width
;
const
_h
=
rectNode
.
height
/
bg
.
height
;
const
pos
=
{
x
:
_x
+
_w
/
2
+
0.5
,
y
:
-
(
_y
+
_h
/
2
-
0.5
)
}
this
.
_lastFingerPosition
=
{
pos
:
pos
,
dirty
:
true
};
})
},
initBg
()
{
...
...
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