Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy_write_word
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
hy_write_word
Commits
1555d306
Commit
1555d306
authored
Sep 19, 2023
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 增加四线三格 音频
parent
ed2dd9ec
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
689 additions
and
495 deletions
+689
-495
hy_write_word.fire
assets/hy_write_word/scene/hy_write_word.fire
+567
-474
hy_write_word.js
assets/hy_write_word/scene/hy_write_word.js
+86
-21
word_bg.jpg
assets/hy_write_word/textures/new/word_bg.jpg
+0
-0
word_bg.jpg.meta
assets/hy_write_word/textures/new/word_bg.jpg.meta
+36
-0
No files found.
assets/hy_write_word/scene/hy_write_word.fire
View file @
1555d306
This diff is collapsed.
Click to expand it.
assets/hy_write_word/scene/hy_write_word.js
View file @
1555d306
...
@@ -273,9 +273,9 @@ cc.Class({
...
@@ -273,9 +273,9 @@ cc.Class({
wordLayer
.
removeAllChildren
();
wordLayer
.
removeAllChildren
();
const
normalLayer
=
new
cc
.
Node
();
const
normalLayer
=
new
cc
.
Node
();
wordLayer
.
addChild
(
normalLayer
);
wordLayer
.
addChild
(
normalLayer
,
2
);
const
strokeLayer
=
new
cc
.
Node
();
const
strokeLayer
=
new
cc
.
Node
();
wordLayer
.
addChild
(
strokeLayer
);
wordLayer
.
addChild
(
strokeLayer
,
2
);
strokeLayer
.
opacity
=
0
;
strokeLayer
.
opacity
=
0
;
this
.
wordLayer
.
normalLayer
=
normalLayer
;
this
.
wordLayer
.
normalLayer
=
normalLayer
;
...
@@ -287,10 +287,29 @@ cc.Class({
...
@@ -287,10 +287,29 @@ cc.Class({
const
aNode
=
getSprNode
(
"
letter/a
"
);
const
aNode
=
getSprNode
(
"
letter/a
"
);
wordLayer
.
height
=
aNode
.
height
;
wordLayer
.
height
=
aNode
.
height
;
const
letterOffsetData
=
{
"
b
"
:
60
,
"
d
"
:
60
,
"
f
"
:
30
,
"
g
"
:
-
105
,
"
h
"
:
65
,
"
i
"
:
45
,
"
j
"
:
-
65
,
"
k
"
:
65
,
"
l
"
:
65
,
"
p
"
:
-
105
,
"
q
"
:
-
105
,
"
t
"
:
50
,
"
y
"
:
-
105
,
}
let
curX
=
0
;
let
curX
=
0
;
const
disX
=
70
;
const
disX
=
70
;
const
letterList
=
this
.
letterList
;
const
letterList
=
this
.
letterList
;
for
(
let
i
=
0
;
i
<
letterList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
letterList
.
length
;
i
++
)
{
const
letter
=
letterList
[
i
];
const
letter
=
letterList
[
i
];
const
resName
=
'
letter/
'
+
letter
;
const
resName
=
'
letter/
'
+
letter
;
const
letterNode
=
getSprNode
(
resName
)
const
letterNode
=
getSprNode
(
resName
)
...
@@ -305,6 +324,16 @@ cc.Class({
...
@@ -305,6 +324,16 @@ cc.Class({
strokeArr
.
push
(
letterSNode
);
strokeArr
.
push
(
letterSNode
);
const
offsetY
=
0
;
const
key
=
letter
.
toLowerCase
();
if
(
letterOffsetData
[
key
])
{
offsetY
=
letterOffsetData
[
key
];
}
letterNode
.
y
=
offsetY
;
letterSNode
.
y
=
offsetY
;
curX
=
letterNode
.
x
+
letterNode
.
width
/
2
;
curX
=
letterNode
.
x
+
letterNode
.
width
/
2
;
// if (i == 0) {
// if (i == 0) {
...
@@ -322,6 +351,14 @@ cc.Class({
...
@@ -322,6 +351,14 @@ cc.Class({
wordLayer
.
x
=
-
wordLayer
.
width
/
2
*
wordLayer
.
scale
;
wordLayer
.
x
=
-
wordLayer
.
width
/
2
*
wordLayer
.
scale
;
wordLayer
.
y
=
240
*
this
.
_mapScaleMin
;
wordLayer
.
y
=
240
*
this
.
_mapScaleMin
;
const
wordBg
=
getSprNode
(
"
word_bg
"
);
wordBg
.
x
=
wordLayer
.
width
/
2
;
wordLayer
.
addChild
(
wordBg
);
wordBg
.
scaleY
=
wordLayer
.
height
/
wordBg
.
height
;
wordBg
.
scaleX
=
wordLayer
.
width
/
wordBg
.
width
;
wordBg
.
opacity
=
0
;
wordLayer
.
wordBg
=
wordBg
;
wordLayer
.
opacity
=
0
;
wordLayer
.
opacity
=
0
;
cc
.
tween
(
wordLayer
)
cc
.
tween
(
wordLayer
)
.
to
(
showTime
,
{
opacity
:
255
},
{
easing
:
"
sineOut
"
})
.
to
(
showTime
,
{
opacity
:
255
},
{
easing
:
"
sineOut
"
})
...
@@ -390,17 +427,23 @@ cc.Class({
...
@@ -390,17 +427,23 @@ cc.Class({
.
to
(
time
,
{
x
:
-
this
.
wordLayer
.
width
/
2
*
targetS
,
y
:
topY
,
scale
:
targetS
},
{
easing
:
"
cubicInOut
"
})
.
to
(
time
,
{
x
:
-
this
.
wordLayer
.
width
/
2
*
targetS
,
y
:
topY
,
scale
:
targetS
},
{
easing
:
"
cubicInOut
"
})
.
start
();
.
start
();
const
{
normalLayer
,
strokeLayer
}
=
this
.
wordLayer
;
const
{
normalLayer
,
strokeLayer
,
wordBg
}
=
this
.
wordLayer
;
cc
.
tween
(
normalLayer
)
cc
.
tween
(
normalLayer
)
.
to
(
time
,
{
opacity
:
0
},
{
easing
:
"
cubicIn
"
})
.
to
(
time
,
{
opacity
:
0
},
{
easing
:
"
cubicIn
"
})
.
call
(()
=>
{
.
call
(()
=>
{
normalLayer
.
active
=
false
;
normalLayer
.
active
=
false
;
cc
.
tween
(
wordBg
)
.
to
(
time
/
2
,
{
opacity
:
255
},
{
easing
:
"
cubicOut
"
})
.
start
();
})
})
.
start
();
.
start
();
cc
.
tween
(
strokeLayer
)
cc
.
tween
(
strokeLayer
)
.
to
(
time
,
{
opacity
:
255
},
{
easing
:
"
cubicOut
"
})
.
to
(
time
,
{
opacity
:
255
},
{
easing
:
"
cubicOut
"
})
.
start
();
.
start
();
},
},
async
hidePic
()
{
async
hidePic
()
{
...
@@ -1385,9 +1428,9 @@ cc.Class({
...
@@ -1385,9 +1428,9 @@ cc.Class({
// }
// }
// }, 260);
// }, 260);
// this.showGold(() => {
this
.
changeNewLetter
();
this
.
changeNewLetter
();
// });
},
},
changeNewLetter
()
{
changeNewLetter
()
{
...
@@ -1497,28 +1540,26 @@ cc.Class({
...
@@ -1497,28 +1540,26 @@ cc.Class({
return
;
return
;
}
}
this
.
playWordAudio
(()
=>
{
setTimeout
(()
=>
{
if
(
this
.
isDestroy
)
{
if
(
this
.
isDestroy
)
{
return
;
return
;
}
}
if
(
this
.
letter_end_Clip
)
{
playAudio
(
this
.
letter_end_Clip
);
}
},
260
);
this
.
showGold
(()
=>
{
this
.
showGold
(()
=>
{
if
(
this
.
isDestroy
)
{
if
(
this
.
isDestroy
)
{
return
;
return
;
}
}
this
.
hideWordLayer
();
this
.
hideWordLayer
();
});
});
// this.hideWordLayer();
})
})
})
})
})
.
start
();
.
start
();
cc
.
tween
(
this
.
wordLayer
.
wordBg
)
.
to
(
time
/
2
,
{
opacity
:
0
},
{
easing
:
"
cubicOut
"
})
.
start
();
},
},
hideWordLayer
()
{
hideWordLayer
()
{
...
@@ -1556,7 +1597,7 @@ cc.Class({
...
@@ -1556,7 +1597,7 @@ cc.Class({
await
asyncDelay
(
1.3
);
await
asyncDelay
(
1.3
);
this
.
wordToCenter
();
this
.
wordToCenter
();
// this.showGold();
// setTimeout(() => {
// setTimeout(() => {
// if (this.isDestroy) {
// if (this.isDestroy) {
...
@@ -1756,7 +1797,31 @@ cc.Class({
...
@@ -1756,7 +1797,31 @@ cc.Class({
return
result
;
return
result
;
},
},
playWordAudio
(
callback
)
{
const
audio_url
=
this
.
curQues
.
audio_url
;
playAudioByUrl
(
audio_url
,
()
=>
{
callback
&&
callback
();
})
},
async
showGold
(
cb
)
{
async
showGold
(
cb
)
{
setTimeout
(()
=>
{
if
(
this
.
isDestroy
)
{
return
;
}
if
(
this
.
letter_end_Clip
)
{
playAudio
(
this
.
letter_end_Clip
);
}
},
260
);
console
.
log
(
'
in showGold
'
)
console
.
log
(
'
in showGold
'
)
const
goldAnim
=
cc
.
instantiate
(
cc
.
find
(
'
Canvas/res/anim/gold_anim
'
));
const
goldAnim
=
cc
.
instantiate
(
cc
.
find
(
'
Canvas/res/anim/gold_anim
'
));
goldAnim
.
active
=
true
;
goldAnim
.
active
=
true
;
...
...
assets/hy_write_word/textures/new/word_bg.jpg
0 → 100644
View file @
1555d306
161 Bytes
assets/hy_write_word/textures/new/word_bg.jpg.meta
0 → 100644
View file @
1555d306
{
"ver": "2.3.5",
"uuid": "136f4d55-0224-4648-8feb-38d49e2fc873",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 381,
"height": 126,
"platformSettings": {},
"subMetas": {
"word_bg": {
"ver": "1.0.4",
"uuid": "32b3a46d-fb03-45b9-803d-a07e925e4136",
"rawTextureUuid": "136f4d55-0224-4648-8feb-38d49e2fc873",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 381,
"height": 126,
"rawWidth": 381,
"rawHeight": 126,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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