Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FT_06
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
FT_06
Commits
a346681e
Commit
a346681e
authored
Oct 14, 2020
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 选项
parent
c2159e42
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
2461 additions
and
117 deletions
+2461
-117
angular.json
form/angular.json
+5
-2
BRLNSDB.TTF
play/assets/tmpGame/fonts/BRLNSDB.TTF
+0
-0
FatMarker.ttf
play/assets/tmpGame/fonts/FatMarker.ttf
+0
-0
FatMarker.ttf.meta
play/assets/tmpGame/fonts/FatMarker.ttf.meta
+5
-0
FT_06.fire
play/assets/tmpGame/scene/FT_06.fire
+1425
-114
FT_06.js
play/assets/tmpGame/scene/FT_06.js
+78
-0
defaultData.js
play/assets/tmpGame/script/defaultData.js
+64
-0
defaultData.js.meta
play/assets/tmpGame/script/defaultData.js.meta
+9
-0
runtime.js
play/assets/tmpGame/script/runtime.js
+727
-0
runtime.js.meta
play/assets/tmpGame/script/runtime.js.meta
+9
-0
utils.js
play/assets/tmpGame/script/utils.js
+102
-0
option_3.png
play/assets/tmpGame/textures/option_3.png
+0
-0
option_3.png.meta
play/assets/tmpGame/textures/option_3.png.meta
+1
-1
option_4.png
play/assets/tmpGame/textures/option_4.png
+0
-0
option_4.png.meta
play/assets/tmpGame/textures/option_4.png.meta
+36
-0
No files found.
form/angular.json
View file @
a346681e
...
@@ -128,5 +128,8 @@
...
@@ -128,5 +128,8 @@
}
}
}
}
},
},
"defaultProject"
:
"ng-template-generator"
"defaultProject"
:
"ng-template-generator"
,
}
"cli"
:
{
"analytics"
:
false
}
}
\ No newline at end of file
play/assets/tmpGame/fonts/BRLNSDB.TTF
deleted
100644 → 0
View file @
c2159e42
File deleted
play/assets/tmpGame/fonts/FatMarker.ttf
0 → 100755
View file @
a346681e
File added
play/assets/tmpGame/fonts/
BRLNSDB.TTF
.meta
→
play/assets/tmpGame/fonts/
FatMarker.ttf
.meta
View file @
a346681e
{
{
"ver": "1.1.0",
"ver": "1.1.0",
"uuid": "
c551970e-b095-45f3-9f1d-25cde8b8deb1
",
"uuid": "
73588b7a-9fa6-4401-a693-8cb0a6c4e8e4
",
"subMetas": {}
"subMetas": {}
}
}
\ No newline at end of file
play/assets/tmpGame/scene/FT_06.fire
View file @
a346681e
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/scene/FT_06.js
View file @
a346681e
...
@@ -91,6 +91,84 @@ cc.Class({
...
@@ -91,6 +91,84 @@ cc.Class({
if
(
this
.
_onLoadFinishFunc
&&
typeof
(
this
.
_onLoadFinishFunc
)
==
'
function
'
)
{
if
(
this
.
_onLoadFinishFunc
&&
typeof
(
this
.
_onLoadFinishFunc
)
==
'
function
'
)
{
this
.
_onLoadFinishFunc
();
this
.
_onLoadFinishFunc
();
}
}
this
.
showQuestion
();
},
initStatus
()
{
this
.
status
=
{
currentQuestionIdx
:
0
}
},
initNodes
()
{
const
tittleLabelNode
=
cc
.
find
(
'
Canvas/bgFrount/leef/TittleLabelNode
'
);
tittleLabelNode
.
getComponent
(
cc
.
Label
).
string
=
this
.
data
.
tittleTxt
;
},
initListeners
()
{
addButtonListener
(
cc
.
find
(
'
Canvas/BtnNode/BtnBefore
'
),
()
=>
{
if
(
this
.
status
.
currentQuestionIdx
<=
0
)
{
return
;
}
this
.
status
.
currentQuestionIdx
--
;
this
.
showQuestion
();
});
addButtonListener
(
cc
.
find
(
'
Canvas/BtnNode/BtnNext
'
),
()
=>
{
if
(
this
.
status
.
currentQuestionIdx
+
1
>=
this
.
data
.
questionList
.
length
)
{
return
;
}
this
.
status
.
currentQuestionIdx
++
;
this
.
showQuestion
();
});
addButtonListener
(
cc
.
find
(
'
Canvas/BtnNode/BtnRefresh
'
),
()
=>
{
this
.
showQuestion
();
});
},
},
updateBgSize
()
{
},
async
showQuestion
()
{
this
.
showOptions
();
await
this
.
questionBoardDown
();
},
showOptions
()
{
for
(
let
i
=
0
;
i
<
4
;
i
++
)
{
const
optionNode
=
cc
.
find
(
`Canvas/optionNode_
${
i
}
`
);
if
(
optionNode
)
{
optionNode
.
removeFromParent
();
}
}
const
optionList
=
this
.
data
.
questionList
[
this
.
status
.
currentQuestionIdx
].
optionList
;
optionList
.
forEach
(
async
(
data
,
idx
)
=>
{
const
optionNode
=
cc
.
instantiate
(
cc
.
find
(
`OptionNodeBase_
${
optionList
.
length
}
`
));
optionNode
.
name
=
`optionNode_
${
idx
}
`
;
optionNode
.
parent
=
cc
.
find
(
'
Canvas
'
);
const
posNode
=
cc
.
find
(
`Canvas/OptionPosListBase/Option_
${
optionList
.
length
}
_
${
idx
}
`
)
optionNode
.
x
=
posNode
.
x
;
optionNode
.
y
=
posNode
.
y
;
const
animeNode
=
await
asyncLoadDragonBoneAnime
(
cc
.
find
(
'
OptionDragonBoneBaseNode
'
,
optionNode
),
data
.
optionDragonBone
);
// await asyncPlayDragonBoneAnimation(cc.find('OptionDragonBoneBaseNode', optionNode), 'normal', 1);
});
},
async
questionBoardDown
()
{
const
questionLabel
=
cc
.
find
(
'
Canvas/QuestionLabelBg/QuestionLabelNode
'
).
getComponent
(
cc
.
Label
);
questionLabel
.
string
=
this
.
data
.
questionList
[
this
.
status
.
currentQuestionIdx
].
questionTxt
;
const
labelBgNode
=
cc
.
find
(
'
Canvas/QuestionLabelBg
'
);
await
asyncTweenTo
(
labelBgNode
,
1
,
{
y
:
263
});
},
async
questionBoardUp
()
{
const
labelBgNode
=
cc
.
find
(
'
Canvas/QuestionLabelBg
'
);
await
asyncTweenTo
(
labelBgNode
,
1
,
{
y
:
463
});
},
});
});
play/assets/tmpGame/script/defaultData.js
0 → 100644
View file @
a346681e
module
.
exports
=
{
"
tittleAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/23376490a9ba0f4a3fe0618fc1c935e1.mp3
"
,
"
tittleTxt
"
:
"
I can do everything
"
,
"
questionList
"
:
[{
"
questionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3
"
,
"
questionTxt
"
:
"
I can stand up.
"
,
"
rightOptionIdx
"
:
1
,
"
optionList
"
:
[{
"
optionDragonBone
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
}
},
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3
"
},
{
"
optionDragonBone
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
}
},
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3
"
},
{
"
optionDragonBone
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
}
},
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3
"
}]
},
{
"
questionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3
"
,
"
questionTxt
"
:
"
I can stand up.
"
,
"
rightOptionIdx
"
:
1
,
"
optionList
"
:
[{
"
optionDragonBone
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
}
},
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3
"
},
{
"
optionDragonBone
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
}
},
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3
"
},
{
"
optionDragonBone
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
}
},
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3
"
},
{
"
optionDragonBone
"
:
{
"
skeJsonData
"
:
{
"
url
"
:
""
},
"
texJsonData
"
:
{
"
url
"
:
""
},
"
texPngData
"
:
{
"
url
"
:
""
}
},
"
optionAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/17edcaecd09a72a64a77480673cdc232.mp3
"
}]
}]
}
\ No newline at end of file
play/assets/tmpGame/script/defaultData.js.meta
0 → 100644
View file @
a346681e
{
"ver": "1.0.8",
"uuid": "6a081092-5433-4e92-b7af-7734f74a9c2c",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/script/runtime.js
0 → 100644
View file @
a346681e
This diff is collapsed.
Click to expand it.
play/assets/tmpGame/script/runtime.js.meta
0 → 100644
View file @
a346681e
{
"ver": "1.0.8",
"uuid": "ef71d5e0-2ae1-48aa-b6c0-27634345db4c",
"isPlugin": true,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
play/assets/tmpGame/script/utils.js
View file @
a346681e
...
@@ -231,3 +231,105 @@ export async function asyncLoadImgByUrl(node, url) {
...
@@ -231,3 +231,105 @@ export async function asyncLoadImgByUrl(node, url) {
loadImgByUrl
(
node
,
url
,
resolve
);
loadImgByUrl
(
node
,
url
,
resolve
);
});
});
}
}
export
function
addButtonListener
(
btnNode
,
func
)
{
btnNode
.
on
(
'
click
'
,
async
(
btn
)
=>
{
if
(
btnNode
.
canNotClick
)
{
return
;
}
btnNode
.
canNotClick
=
true
;
playEffect
(
'
按钮
'
);
await
jelly
(
btnNode
);
await
func
(
btn
);
btnNode
.
canNotClick
=
false
;
});
}
export
async
function
asyncLoadDragonBoneAnime
(
node
,
{
skeJsonData
:
{
url
:
skeJsonDataUrl
},
texJsonData
:
{
url
:
texJsonDataUrl
},
texPngData
:
{
url
:
texPngDataUrl
}
})
{
if
(
!
texPngDataUrl
||
!
texJsonDataUrl
||
!
texPngDataUrl
)
{
return
;
}
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
node
.
animaNode
)
{
node
.
animaNode
.
removeFromParent
();
}
const
animaNode
=
new
cc
.
Node
();
animaNode
.
name
=
'
animaNode
'
;
animaNode
.
parent
=
node
;
animaNode
.
active
=
true
;
node
.
animaNode
=
animaNode
;
const
dragonDisplay
=
animaNode
.
addComponent
(
dragonBones
.
ArmatureDisplay
);
// cc.assetManager.loadRemote(texPngDataUrl, (error, texture) => {
// cc.assetManager.loadAny({ url: texJsonDataUrl }, (error, atlasJson) => {
// cc.assetManager.loadAny({ url: skeJsonDataUrl }, (error, dragonBonesJson) => {
// const atlas = new dragonBones.DragonBonesAtlasAsset();
// atlas.atlasJson = JSON.stringify(atlasJson);
// atlas.texture = texture;
// const asset = new dragonBones.DragonBonesAsset();
// asset.dragonBonesJson = JSON.stringify(dragonBonesJson);
// dragonDisplay.dragonAtlasAsset = atlas;
// dragonDisplay.dragonAsset = asset;
// let armatureNames = dragonBonesJson.armature.map(data => data.name);
// if (armatureNames.length > 0) {
// dragonDisplay.armatureName = armatureNames[0];
// }
// resolve(animaNode);
// });
// });
// });
const
loadTexture
=
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
assetManager
.
loadRemote
(
texPngDataUrl
,
(
error
,
texture
)
=>
{
if
(
error
)
{
reject
(
error
);
}
resolve
(
texture
);
});
});
const
loadTexJsonData
=
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
assetManager
.
loadAny
({
url
:
texJsonDataUrl
},
(
error
,
atlasJson
)
=>
{
if
(
error
)
{
reject
(
error
);
}
resolve
(
atlasJson
);
});
});
const
loadSkeJsonData
=
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
assetManager
.
loadAny
({
url
:
skeJsonDataUrl
},
(
error
,
dragonBonesJson
)
=>
{
if
(
error
)
{
reject
(
error
);
}
resolve
(
dragonBonesJson
);
});
});
Promise
.
all
([
loadTexture
,
loadTexJsonData
,
loadSkeJsonData
]).
then
(([
texture
,
atlasJson
,
dragonBonesJson
])
=>
{
const
atlas
=
new
dragonBones
.
DragonBonesAtlasAsset
();
atlas
.
atlasJson
=
JSON
.
stringify
(
atlasJson
);
atlas
.
texture
=
texture
;
const
asset
=
new
dragonBones
.
DragonBonesAsset
();
asset
.
dragonBonesJson
=
JSON
.
stringify
(
dragonBonesJson
);
dragonDisplay
.
dragonAtlasAsset
=
atlas
;
dragonDisplay
.
dragonAsset
=
asset
;
let
armatureNames
=
dragonBonesJson
.
armature
.
map
(
data
=>
data
.
name
);
if
(
armatureNames
.
length
>
0
)
{
dragonDisplay
.
armatureName
=
armatureNames
[
0
];
}
resolve
(
animaNode
);
});
});
}
\ No newline at end of file
play/assets/tmpGame/textures/option.png
→
play/assets/tmpGame/textures/option
_3
.png
View file @
a346681e
File moved
play/assets/tmpGame/textures/option.png.meta
→
play/assets/tmpGame/textures/option
_3
.png.meta
View file @
a346681e
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
"height": 154,
"height": 154,
"platformSettings": {},
"platformSettings": {},
"subMetas": {
"subMetas": {
"option": {
"option
_3
": {
"ver": "1.0.4",
"ver": "1.0.4",
"uuid": "08a24fc8-782c-40d4-be3e-5123f1695dfb",
"uuid": "08a24fc8-782c-40d4-be3e-5123f1695dfb",
"rawTextureUuid": "e9bcc801-4c45-45ef-9761-a569328686c9",
"rawTextureUuid": "e9bcc801-4c45-45ef-9761-a569328686c9",
...
...
play/assets/tmpGame/textures/option_4.png
0 → 100644
View file @
a346681e
62.5 KB
play/assets/tmpGame/textures/option_4.png.meta
0 → 100644
View file @
a346681e
{
"ver": "2.3.5",
"uuid": "7c942112-0d58-4846-a60c-0dd73b7abbd6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 322,
"height": 115,
"platformSettings": {},
"subMetas": {
"option_4": {
"ver": "1.0.4",
"uuid": "8471267b-453c-4c90-9bcd-d086725c0376",
"rawTextureUuid": "7c942112-0d58-4846-a60c-0dd73b7abbd6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 322,
"height": 115,
"rawWidth": 322,
"rawHeight": 115,
"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