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
9d03152a
Commit
9d03152a
authored
Dec 15, 2020
by
asdf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
df41b208
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
36 deletions
+54
-36
ItemIndicator.prefab.meta
play/assets/tmpGame/prefabs/ItemIndicator.prefab.meta
+1
-1
ItemPage.prefab.meta
play/assets/tmpGame/prefabs/ItemPage.prefab.meta
+1
-1
Scene.fire.meta
play/assets/tmpGame/scene/Scene.fire.meta
+1
-1
ItemPage.js
play/assets/tmpGame/script/ItemPage.js
+24
-10
Scene.js
play/assets/tmpGame/script/Scene.js
+26
-22
project.json
play/project.json
+1
-1
No files found.
play/assets/tmpGame/prefabs/ItemIndicator.prefab.meta
View file @
9d03152a
{
"ver": "1.2.
9
",
"ver": "1.2.
7
",
"uuid": "196ced84-f877-4734-bed7-931dcdf479fc",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
...
...
play/assets/tmpGame/prefabs/ItemPage.prefab.meta
View file @
9d03152a
{
"ver": "1.2.
9
",
"ver": "1.2.
7
",
"uuid": "d49720e9-3f1f-42ec-9b9b-dc90d989fee4",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
...
...
play/assets/tmpGame/scene/Scene.fire.meta
View file @
9d03152a
{
"ver": "1.2.
9
",
"ver": "1.2.
7
",
"uuid": "57ea7c61-9b8b-498a-b024-c98ee9124beb",
"asyncLoadAssets": false,
"autoReleaseAssets": true,
...
...
play/assets/tmpGame/script/ItemPage.js
View file @
9d03152a
...
...
@@ -19,7 +19,7 @@ cc.Class({
this
.
node
.
off
(
'
touchend
'
,
this
.
onTouchEnd
,
this
);
},
onTouchEnd
()
{
onTouchEnd
(
event
)
{
this
.
scheduleOnce
(()
=>
{
if
(
GameData
.
_isPageTurning
)
{
return
;
...
...
@@ -65,9 +65,7 @@ cc.Class({
if
(
this
.
data
.
type
==
'
Image
'
)
{
return
;
}
this
.
dragonBone
.
dragonAtlasAsset
=
null
;
this
.
dragonBone
.
dragonAsset
=
null
;
this
.
dragonBone
.
armatureName
=
''
;
GameData
.
loadDBCount
++
;
var
imageUrl
=
this
.
data
.
tex_png
;
var
skeUrl
=
this
.
data
.
ske_json
;
var
atlasUrl
=
this
.
data
.
tex_json
;
...
...
@@ -106,8 +104,22 @@ cc.Class({
this
.
dragonBone
.
armatureName
=
data
.
name
;
this
.
animationName
=
data
.
animation
[
0
].
name
;
this
.
dragonBone
.
animationName
=
this
.
animationName
;
this
.
dragonBone
.
premultipliedAlpha
=
true
;
atlas
.
texture
.
setPremultiplyAlpha
(
true
);
GameData
.
loadDBCb
.
push
(()
=>
{
if
(
this
.
hadSetPremultiplyAlpha
){
return
;
}
this
.
hadSetPremultiplyAlpha
=
true
;
this
.
dragonBone
.
premultipliedAlpha
=
true
;
this
.
dragonBone
.
dragonAtlasAsset
.
texture
.
setPremultiplyAlpha
(
true
);
})
GameData
.
loadDBCount
--
;
if
(
GameData
.
loadDBCount
<=
0
)
{
for
(
let
i
=
0
;
i
<
GameData
.
loadDBCb
.
length
;
i
++
)
{
GameData
.
loadDBCb
[
i
]
&&
GameData
.
loadDBCb
[
i
]();
}
}
this
.
setSpineScale
(
data
.
canvas
);
}
});
...
...
@@ -209,7 +221,6 @@ cc.Class({
this
.
textIndex
=
0
;
this
.
schedule
(
this
.
chengeTextColor
,
this
.
textDuration
,
this
.
layoutText
.
childrenCount
,
0.01
)
});
this
.
playSpine
();
},
stopAudio
()
{
cc
.
audioEngine
.
stop
(
this
.
audioID
);
...
...
@@ -221,7 +232,12 @@ cc.Class({
this
.
dragonBone
.
playAnimation
(
this
.
animationName
,
1
);
},
stopSpine
()
{
this
.
loadSpine
();
this
.
dragonBone
.
dragonAtlasAsset
=
null
;
this
.
dragonBone
.
dragonAsset
=
null
;
this
.
dragonBone
.
armatureName
=
''
;
this
.
scheduleOnce
(()
=>
{
this
.
loadSpine
();
})
},
chengeTextColor
()
{
...
...
@@ -247,11 +263,9 @@ cc.Class({
playPageUp
()
{
this
.
anim
.
play
(
'
pageUp
'
);
this
.
stopAudio
();
},
playPageDown
()
{
this
.
anim
.
play
(
'
pageDown
'
);
this
.
stopAudio
();
},
showMask
()
{
...
...
play/assets/tmpGame/script/Scene.js
View file @
9d03152a
...
...
@@ -17,6 +17,8 @@ cc.Class({
onLoad
()
{
this
.
initSceneData
();
this
.
initSize
();
},
onEnable
()
{
...
...
@@ -71,7 +73,6 @@ cc.Class({
_audioResList
:
null
,
_animaResList
:
null
,
initSceneData
()
{
this
.
_currPageIndex
=
0
;
this
.
_startX
=
0
;
this
.
_endX
=
0
;
this
.
_pagesList
=
[];
...
...
@@ -80,7 +81,10 @@ cc.Class({
this
.
_audioResList
=
[];
this
.
_animaResList
=
[];
window
.
GameData
=
{};
GameData
.
_currPageIndex
=
0
;
GameData
.
_isPageTurning
=
false
;
GameData
.
loadDBCount
=
0
;
GameData
.
loadDBCb
=
[];
},
_designSize
:
null
,
// 设计分辨率
...
...
@@ -138,7 +142,7 @@ cc.Class({
},
getDefaultData
()
{
const
dataJson
=
'
{"contentObj":{"version":"1.1","key":"DataKey_Cocos_Test","haveCover":true,"dataArray":[{"type":"Spine","text":"没 有 数 据","image_url":""},{"type":"Spine","text":"没 有 数 据","image_url":""}]}}
'
const
dataJson
=
'
{"contentObj":{"version":"1.1","key":"DataKey_Cocos_Test","haveCover":true,"dataArray":[{"type":"Spine","text":"没 有 数 据","image_url":""},{"type":"Spine","text":"没 有 数 据","image_url":""}
,{"type":"Spine","text":"没 有 数 据","image_url":""},{"type":"Spine","text":"没 有 数 据","image_url":""}
]}}
'
const
data
=
JSON
.
parse
(
dataJson
);
return
data
;
},
...
...
@@ -306,18 +310,18 @@ cc.Class({
}
// 已经是最后一页了
let
len
=
this
.
data
.
contentObj
.
dataArray
.
length
;
if
(
this
.
_currPageIndex
+
1
>=
len
)
{
if
(
GameData
.
_currPageIndex
+
1
>=
len
)
{
return
;
}
this
.
showPageMask
(
this
.
_currPageIndex
+
1
);
this
.
hidePageMaskAction
(
this
.
_currPageIndex
+
1
);
this
.
stopPageAudio
(
this
.
_currPageIndex
);
this
.
stopPageAudio
(
this
.
_currPageIndex
+
1
);
this
.
_pagesList
[
this
.
_currPageIndex
].
playPageDown
();
this
.
_currPageIndex
++
;
this
.
showPageMask
(
GameData
.
_currPageIndex
+
1
);
this
.
hidePageMaskAction
(
GameData
.
_currPageIndex
+
1
);
this
.
stopPageAudio
(
GameData
.
_currPageIndex
);
this
.
stopPageAudio
(
GameData
.
_currPageIndex
+
1
);
this
.
_pagesList
[
GameData
.
_currPageIndex
].
playPageDown
();
GameData
.
_currPageIndex
++
;
GameData
.
_isPageTurning
=
true
;
this
.
scheduleOnce
(
this
.
onPageDownDone
,
0.75
)
this
.
_pagesList
[
this
.
_currPageIndex
].
onCurrPage
();
this
.
_pagesList
[
GameData
.
_currPageIndex
].
onCurrPage
();
cc
.
audioEngine
.
play
(
this
.
audTurnPage
);
},
// 上一页
...
...
@@ -326,18 +330,18 @@ cc.Class({
return
;
}
// 已经是第一页了
if
(
this
.
_currPageIndex
==
0
)
{
if
(
GameData
.
_currPageIndex
==
0
)
{
return
;
}
this
.
_currPageIndex
--
;
this
.
hidePageMask
(
this
.
_currPageIndex
+
1
);
this
.
showPageMaskAction
(
this
.
_currPageIndex
+
1
);
this
.
stopPageAudio
(
this
.
_currPageIndex
);
this
.
stopPageAudio
(
this
.
_currPageIndex
+
1
);
this
.
_pagesList
[
this
.
_currPageIndex
].
playPageUp
();
GameData
.
_currPageIndex
--
;
this
.
hidePageMask
(
GameData
.
_currPageIndex
+
1
);
this
.
showPageMaskAction
(
GameData
.
_currPageIndex
+
1
);
this
.
stopPageAudio
(
GameData
.
_currPageIndex
);
this
.
stopPageAudio
(
GameData
.
_currPageIndex
+
1
);
this
.
_pagesList
[
GameData
.
_currPageIndex
].
playPageUp
();
GameData
.
_isPageTurning
=
true
;
this
.
scheduleOnce
(
this
.
onPageUpDone
,
0.75
)
this
.
_pagesList
[
this
.
_currPageIndex
].
onCurrPage
();
this
.
_pagesList
[
GameData
.
_currPageIndex
].
onCurrPage
();
cc
.
audioEngine
.
play
(
this
.
audTurnPage
);
},
// 显示下一页的黑色遮罩
...
...
@@ -390,11 +394,11 @@ cc.Class({
refreshIndicator
(
isPageDown
)
{
if
(
isPageDown
)
{
this
.
_indicatorList
[
this
.
_currPageIndex
]
&&
this
.
_indicatorList
[
this
.
_currPageIndex
].
select
();
this
.
_indicatorList
[
this
.
_currPageIndex
-
1
]
&&
this
.
_indicatorList
[
this
.
_currPageIndex
-
1
].
unselect
();
this
.
_indicatorList
[
GameData
.
_currPageIndex
]
&&
this
.
_indicatorList
[
GameData
.
_currPageIndex
].
select
();
this
.
_indicatorList
[
GameData
.
_currPageIndex
-
1
]
&&
this
.
_indicatorList
[
GameData
.
_currPageIndex
-
1
].
unselect
();
}
else
{
this
.
_indicatorList
[
this
.
_currPageIndex
]
&&
this
.
_indicatorList
[
this
.
_currPageIndex
].
select
();
this
.
_indicatorList
[
this
.
_currPageIndex
+
1
]
&&
this
.
_indicatorList
[
this
.
_currPageIndex
+
1
].
unselect
();
this
.
_indicatorList
[
GameData
.
_currPageIndex
]
&&
this
.
_indicatorList
[
GameData
.
_currPageIndex
].
select
();
this
.
_indicatorList
[
GameData
.
_currPageIndex
+
1
]
&&
this
.
_indicatorList
[
GameData
.
_currPageIndex
+
1
].
unselect
();
}
},
...
...
play/project.json
View file @
9d03152a
...
...
@@ -3,6 +3,6 @@
"packages"
:
"packages"
,
"name"
:
"play"
,
"id"
:
"9af72fd2-44a6-4131-8ea3-3e1b3fa22231"
,
"version"
:
"2.4.
3
"
,
"version"
:
"2.4.
0
"
,
"isNew"
:
false
}
\ 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