Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Sbx_pageturn
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
Sbx_pageturn
Commits
c30f1a6c
Commit
c30f1a6c
authored
Jan 21, 2022
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 重音问题
parent
eef99449
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
13 deletions
+26
-13
ItemPage.js
assets/Sbx_pageturn/script/ItemPage.js
+26
-13
No files found.
assets/Sbx_pageturn/script/ItemPage.js
View file @
c30f1a6c
...
@@ -30,15 +30,6 @@ cc.Class({
...
@@ -30,15 +30,6 @@ cc.Class({
}
}
},
},
log
(
str
)
{
const
middleLayerNode
=
cc
.
find
(
'
middleLayer
'
)
if
(
middleLayerNode
)
{
middleLayerNode
.
getComponent
(
'
middleLayer
'
).
log
(
str
);
}
else
{
console
.
log
(
str
);
}
},
onTouchEnd
(
event
)
{
onTouchEnd
(
event
)
{
this
.
scheduleOnce
(()
=>
{
this
.
scheduleOnce
(()
=>
{
if
(
GameData
.
_isPageTurning
)
{
if
(
GameData
.
_isPageTurning
)
{
...
@@ -179,7 +170,7 @@ cc.Class({
...
@@ -179,7 +170,7 @@ cc.Class({
this
.
dragonBone
.
node
.
scale
=
bgHeight
/
size
.
height
;
this
.
dragonBone
.
node
.
scale
=
bgHeight
/
size
.
height
;
}
}
}
}
console
.
log
(
this
.
dragonBone
.
node
.
scale
)
console
.
log
(
this
.
dragonBone
.
node
.
scale
)
mask
.
width
=
this
.
dragonBone
.
node
.
scale
*
size
.
width
;
mask
.
width
=
this
.
dragonBone
.
node
.
scale
*
size
.
width
;
mask
.
height
=
this
.
dragonBone
.
node
.
scale
*
size
.
height
;
mask
.
height
=
this
.
dragonBone
.
node
.
scale
*
size
.
height
;
...
@@ -222,16 +213,30 @@ cc.Class({
...
@@ -222,16 +213,30 @@ cc.Class({
}
}
},
},
async
asyncDelay
(
time
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
tween
(
this
.
node
)
.
delay
(
time
)
.
call
(()
=>
{
resolve
();
})
.
start
();
});
},
playAudio
()
{
playAudio
()
{
// this.data.shortAudio_url = 'http://127.0.0.1/iamflying.mp3';
// this.data.shortAudio_url = 'http://127.0.0.1/iamflying.mp3';
cc
.
assetManager
.
loadRemote
(
this
.
data
.
shortAudio_url
,
null
,
(
err
,
clip
)
=>
{
cc
.
assetManager
.
loadRemote
(
this
.
data
.
shortAudio_url
,
null
,
async
(
err
,
clip
)
=>
{
this
.
audioID
=
cc
.
audioEngine
.
play
(
clip
,
false
,
1
);
this
.
audioID
=
cc
.
audioEngine
.
play
(
clip
,
false
,
1
);
await
asyncDelay
(
0.01
);
this
.
audioDuration
=
cc
.
audioEngine
.
getDuration
(
this
.
audioID
);
this
.
audioDuration
=
cc
.
audioEngine
.
getDuration
(
this
.
audioID
);
this
.
textDuration
=
this
.
audioDuration
/
this
.
layoutText
.
childrenCount
;
this
.
textDuration
=
this
.
audioDuration
/
this
.
layoutText
.
childrenCount
;
this
.
textIndex
=
0
;
this
.
textIndex
=
0
;
if
(
this
.
textDuration
==
-
1
)
{
await
asyncDelay
(
0.01
);
this
.
textDuration
=
1
;
if
(
this
.
textDuration
<=
0
)
{
this
.
textDuration
=
1
}
}
this
.
schedule
(
this
.
chengeTextColor
,
this
.
textDuration
,
this
.
layoutText
.
childrenCount
,
0.01
)
this
.
schedule
(
this
.
chengeTextColor
,
this
.
textDuration
,
this
.
layoutText
.
childrenCount
,
0.01
)
...
@@ -308,5 +313,13 @@ cc.Class({
...
@@ -308,5 +313,13 @@ cc.Class({
.
start
()
.
start
()
},
},
log
(
str
)
{
const
middleLayerNode
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayerNode
)
{
middleLayerNode
.
getComponent
(
'
middleLayer
'
).
log
(
str
);
}
console
.
log
(
str
);
},
// update (dt) {},
// update (dt) {},
});
});
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