Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ET_07
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
ET_07
Commits
e6eca39c
Commit
e6eca39c
authored
Feb 26, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 点击空白处开写
parent
ae67e23f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
ET_07.js
play/assets/ET_07/scene/ET_07.js
+20
-6
No files found.
play/assets/ET_07/scene/ET_07.js
View file @
e6eca39c
...
...
@@ -137,7 +137,7 @@ cc.Class({
this
.
initView
();
this
.
initListener
();
this
.
showLetterAnimation
();
//
this.showLetterAnimation();
this
.
startEditMode
();
},
...
...
@@ -253,6 +253,12 @@ cc.Class({
return
pos1
.
sub
(
pos2
).
mag
();
},
drawALineLast
(
drawNode
,
fromPos
,
toPos
,
color
,
drawIdx
)
{
if
(
drawIdx
==
this
.
_writingIdx
)
{
this
.
drawALine
(
drawNode
,
fromPos
,
toPos
,
color
);
}
},
drawALine
(
drawNode
,
fromPos
,
toPos
,
color
)
{
const
graph
=
drawNode
.
getComponent
(
cc
.
Graphics
);
if
(
color
)
{
...
...
@@ -293,7 +299,10 @@ cc.Class({
letterBg
.
x
=
0
;
letterBg
.
y
=
0
;
letterBg
.
parent
=
letterBaseNode
;
cc
.
find
(
'
LetterMask/bg
'
,
letterBg
).
active
=
false
;
const
bg
=
cc
.
find
(
'
LetterMask/bg
'
,
letterBg
);
bg
.
active
=
true
;
bg
.
opacity
=
255
;
// cc.find('LetterMask/bg', letterBg).active = false;
return
letterBg
;
},
...
...
@@ -305,6 +314,11 @@ cc.Class({
const
BtnBigLetter
=
cc
.
find
(
'
Canvas/bg/BtnBigLetter
'
);
const
BtnSmallLetter
=
cc
.
find
(
'
Canvas/bg/BtnSmallLetter
'
);
const
bgBtn
=
cc
.
find
(
'
Canvas/bg/Img_letter_bg
'
);
bgBtn
.
on
(
'
click
'
,
()
=>
{
this
.
showLetterAnimation
();
});
BtnBigLetter
.
on
(
'
click
'
,
()
=>
{
BtnBigLetter
.
getChildByName
(
'
Img_normal
'
).
active
=
false
;
BtnSmallLetter
.
getChildByName
(
'
Img_normal
'
).
active
=
true
;
...
...
@@ -316,7 +330,7 @@ cc.Class({
cc
.
audioEngine
.
play
(
this
.
switchAudio
,
false
,
0.8
);
this
.
setLetter
(
this
.
letter
.
toUpperCase
());
this
.
showLetterAnimation
();
//
this.showLetterAnimation();
this
.
startEditMode
();
});
BtnSmallLetter
.
on
(
'
click
'
,
()
=>
{
...
...
@@ -330,7 +344,7 @@ cc.Class({
cc
.
audioEngine
.
play
(
this
.
switchAudio
,
false
,
0.8
);
this
.
setLetter
(
this
.
letter
.
toLowerCase
());
this
.
showLetterAnimation
();
//
this.showLetterAnimation();
this
.
startEditMode
();
});
...
...
@@ -373,7 +387,7 @@ cc.Class({
this
.
_writingIdx
++
;
const
writingIdx
=
this
.
_writingIdx
;
console
.
log
(
'
set writingIdx =
'
+
writingIdx
);
// cc.find(`Canvas/bg/Img_letter_bg/Img_letter_bg_${this.letter}/LetterMask/bg`).active = tru
e;
cc
.
find
(
`Canvas/bg/Img_letter_bg/Img_letter_bg_
${
this
.
letter
}
/LetterMask/bg`
).
active
=
fals
e
;
const
drawNode
=
cc
.
find
(
`Canvas/bg/Img_letter_bg/Img_letter_bg_
${
this
.
letter
}
/LetterMask/DrawNode`
);
const
graph
=
drawNode
.
getComponent
(
cc
.
Graphics
);
graph
.
clear
();
...
...
@@ -382,7 +396,7 @@ cc.Class({
const
lienList
=
this
.
getLineList
(
posList
);
for
(
const
pen
of
lienList
)
{
for
(
const
line
of
pen
)
{
this
.
drawALine
(
drawNode
,
line
.
startPos
,
line
.
endPos
,
cc
.
color
(
181
,
39
,
48
)
);
this
.
drawALine
Last
(
drawNode
,
line
.
startPos
,
line
.
endPos
,
cc
.
color
(
181
,
39
,
48
),
writingIdx
);
await
asyncDelay
(
0.02
);
}
await
asyncDelay
(
0.1
);
...
...
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