Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Sbx_Pronunciation
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_Pronunciation
Commits
e6f69244
Commit
e6f69244
authored
Dec 06, 2020
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev commit
parent
4c78341b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
292 additions
and
55 deletions
+292
-55
Scene.fire
play/assets/tmpGame/scene/Scene.fire
+168
-46
GameLogic.js
play/assets/tmpGame/script/GameLogic.js
+124
-9
No files found.
play/assets/tmpGame/scene/Scene.fire
View file @
e6f69244
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
"__id__": 2
"__id__": 2
},
},
{
{
"__id__": 4
5
"__id__": 4
7
}
}
],
],
"_active": false,
"_active": false,
...
@@ -81,28 +81,28 @@
...
@@ -81,28 +81,28 @@
"__id__": 14
"__id__": 14
},
},
{
{
"__id__":
19
"__id__":
20
},
},
{
{
"__id__": 2
3
"__id__": 2
5
},
},
{
{
"__id__": 2
7
"__id__": 2
9
},
},
{
{
"__id__": 3
5
"__id__": 3
7
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 4
2
"__id__": 4
4
},
},
{
{
"__id__": 4
3
"__id__": 4
5
},
},
{
{
"__id__": 4
4
"__id__": 4
6
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -707,6 +707,9 @@
...
@@ -707,6 +707,9 @@
},
},
{
{
"__id__": 17
"__id__": 17
},
{
"__id__": 19
}
}
],
],
"_active": true,
"_active": true,
...
@@ -937,6 +940,64 @@
...
@@ -937,6 +940,64 @@
"_atlas": null,
"_atlas": null,
"_id": "12TIQc9L1O1rIp4hQFAqb3"
"_id": "12TIQc9L1O1rIp4hQFAqb3"
},
},
{
"__type__": "cc.Node",
"_name": "bg_D",
"_objFlags": 0,
"_parent": {
"__id__": 14
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 668,
"height": 353
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-1.638,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "7dlwtZVwFGLoDb7p7Q9Bzx"
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "text_container",
"_name": "text_container",
...
@@ -946,10 +1007,13 @@
...
@@ -946,10 +1007,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 2
0
"__id__": 2
1
},
},
{
{
"__id__": 22
"__id__": 23
},
{
"__id__": 24
}
}
],
],
"_active": true,
"_active": true,
...
@@ -1007,13 +1071,13 @@
...
@@ -1007,13 +1071,13 @@
"_name": "bg_A",
"_name": "bg_A",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
19
"__id__":
20
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 2
1
"__id__": 2
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1069,7 +1133,7 @@
...
@@ -1069,7 +1133,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 2
0
"__id__": 2
1
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1096,12 +1160,70 @@
...
@@ -1096,12 +1160,70 @@
"_atlas": null,
"_atlas": null,
"_id": "7dkqY/AVNGFJQQifsWIdIt"
"_id": "7dkqY/AVNGFJQQifsWIdIt"
},
},
{
"__type__": "cc.Node",
"_name": "bg_D",
"_objFlags": 0,
"_parent": {
"__id__": 20
},
"_children": [],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 602,
"height": 164
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "64n2FQM9pNYpt0F56an/DX"
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "DB",
"_name": "DB",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
19
"__id__":
20
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
...
@@ -1163,10 +1285,10 @@
...
@@ -1163,10 +1285,10 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 2
4
"__id__": 2
6
},
},
{
{
"__id__": 2
6
"__id__": 2
8
}
}
],
],
"_active": true,
"_active": true,
...
@@ -1224,13 +1346,13 @@
...
@@ -1224,13 +1346,13 @@
"_name": "bg",
"_name": "bg",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
3
"__id__": 2
5
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 2
5
"__id__": 2
7
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1286,7 +1408,7 @@
...
@@ -1286,7 +1408,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 2
4
"__id__": 2
6
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1318,7 +1440,7 @@
...
@@ -1318,7 +1440,7 @@
"_name": "dragonBones",
"_name": "dragonBones",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
3
"__id__": 2
5
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
...
@@ -1380,13 +1502,13 @@
...
@@ -1380,13 +1502,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__":
28
"__id__":
30
},
},
{
{
"__id__": 3
1
"__id__": 3
3
},
},
{
{
"__id__": 3
4
"__id__": 3
6
}
}
],
],
"_active": false,
"_active": false,
...
@@ -1444,11 +1566,11 @@
...
@@ -1444,11 +1566,11 @@
"_name": "font",
"_name": "font",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
7
"__id__": 2
9
},
},
"_children": [
"_children": [
{
{
"__id__":
29
"__id__":
31
}
}
],
],
"_active": true,
"_active": true,
...
@@ -1506,13 +1628,13 @@
...
@@ -1506,13 +1628,13 @@
"_name": "Comic Sans MS",
"_name": "Comic Sans MS",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
28
"__id__":
30
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
0
"__id__": 3
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1568,7 +1690,7 @@
...
@@ -1568,7 +1690,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
29
"__id__":
31
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [],
...
@@ -1600,11 +1722,11 @@
...
@@ -1600,11 +1722,11 @@
"_name": "img",
"_name": "img",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
7
"__id__": 2
9
},
},
"_children": [
"_children": [
{
{
"__id__": 3
2
"__id__": 3
4
}
}
],
],
"_active": true,
"_active": true,
...
@@ -1662,13 +1784,13 @@
...
@@ -1662,13 +1784,13 @@
"_name": "black",
"_name": "black",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 3
1
"__id__": 3
3
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
3
"__id__": 3
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1724,7 +1846,7 @@
...
@@ -1724,7 +1846,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
2
"__id__": 3
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [],
...
@@ -1752,7 +1874,7 @@
...
@@ -1752,7 +1874,7 @@
"_name": "audio",
"_name": "audio",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 2
7
"__id__": 2
9
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
...
@@ -1813,14 +1935,14 @@
...
@@ -1813,14 +1935,14 @@
"__id__": 2
"__id__": 2
},
},
"_children": [
"_children": [
{
"__id__": 36
},
{
{
"__id__": 38
"__id__": 38
},
},
{
{
"__id__": 40
"__id__": 40
},
{
"__id__": 42
}
}
],
],
"_active": true,
"_active": true,
...
@@ -1878,13 +2000,13 @@
...
@@ -1878,13 +2000,13 @@
"_name": "btn_right",
"_name": "btn_right",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 3
5
"__id__": 3
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
7
"__id__": 3
9
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1940,7 +2062,7 @@
...
@@ -1940,7 +2062,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 3
6
"__id__": 3
8
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -1972,13 +2094,13 @@
...
@@ -1972,13 +2094,13 @@
"_name": "btn_left",
"_name": "btn_left",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 3
5
"__id__": 3
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
39
"__id__":
41
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2034,7 +2156,7 @@
...
@@ -2034,7 +2156,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
38
"__id__":
40
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -2066,13 +2188,13 @@
...
@@ -2066,13 +2188,13 @@
"_name": "btn_restart",
"_name": "btn_restart",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 3
5
"__id__": 3
7
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 4
1
"__id__": 4
3
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -2128,7 +2250,7 @@
...
@@ -2128,7 +2250,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 4
0
"__id__": 4
2
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
...
play/assets/tmpGame/script/GameLogic.js
View file @
e6f69244
...
@@ -37,6 +37,7 @@ export default class GameLogic {
...
@@ -37,6 +37,7 @@ export default class GameLogic {
this
.
initBg
()
this
.
initBg
()
this
.
initNodes
();
this
.
initNodes
();
this
.
resetPosition
();
this
.
resetPosition
();
this
.
initTheme
();
this
.
addEventListener
();
this
.
addEventListener
();
this
.
initBottomButtons
();
this
.
initBottomButtons
();
this
.
initDragonContainers
();
this
.
initDragonContainers
();
...
@@ -56,6 +57,16 @@ export default class GameLogic {
...
@@ -56,6 +57,16 @@ export default class GameLogic {
this
.
g_cartoon
.
initCartoonElement
(
`btn_left`
,
this
.
g_cartoon
.
getNodeByPath
(
`Canvas/bottomButtons/btn_left`
));
this
.
g_cartoon
.
initCartoonElement
(
`btn_left`
,
this
.
g_cartoon
.
getNodeByPath
(
`Canvas/bottomButtons/btn_left`
));
this
.
g_cartoon
.
initCartoonElement
(
`btn_restart`
,
this
.
g_cartoon
.
getNodeByPath
(
`Canvas/bottomButtons/btn_restart`
));
this
.
g_cartoon
.
initCartoonElement
(
`btn_restart`
,
this
.
g_cartoon
.
getNodeByPath
(
`Canvas/bottomButtons/btn_restart`
));
this
.
g_cartoon
.
initCartoonElement
(
`btn_right`
,
this
.
g_cartoon
.
getNodeByPath
(
`Canvas/bottomButtons/btn_right`
));
this
.
g_cartoon
.
initCartoonElement
(
`btn_right`
,
this
.
g_cartoon
.
getNodeByPath
(
`Canvas/bottomButtons/btn_right`
));
this
.
g_cartoon
.
initCartoonElement
(
`videoTheme_A`
,
this
.
g_cartoon
.
getNodeByPath
(
`Canvas/video_container/bg_A`
));
// this.g_cartoon.initCartoonElement(`videoTheme_B`, this.g_cartoon.getNodeByPath(`Canvas/video_container/bg_D`));
// this.g_cartoon.initCartoonElement(`videoTheme_C`, this.g_cartoon.getNodeByPath(`Canvas/video_container/bg_D`));
this
.
g_cartoon
.
initCartoonElement
(
`videoTheme_D`
,
this
.
g_cartoon
.
getNodeByPath
(
`Canvas/video_container/bg_D`
));
this
.
g_cartoon
.
initCartoonElement
(
`textTheme_A`
,
this
.
g_cartoon
.
getNodeByPath
(
`Canvas/text_container/bg_A`
));
// this.g_cartoon.initCartoonElement(`textTheme_B`, this.g_cartoon.getNodeByPath(`Canvas/text_container/bg_D`));
// this.g_cartoon.initCartoonElement(`textTheme_C`, this.g_cartoon.getNodeByPath(`Canvas/text_container/bg_D`));
this
.
g_cartoon
.
initCartoonElement
(
`textTheme_D`
,
this
.
g_cartoon
.
getNodeByPath
(
`Canvas/text_container/bg_D`
));
}
}
addEventListener
()
{
addEventListener
()
{
...
@@ -72,6 +83,91 @@ export default class GameLogic {
...
@@ -72,6 +83,91 @@ export default class GameLogic {
console
.
log
(
bgNode_A
.
height
,
bgNode_A
.
width
)
console
.
log
(
bgNode_A
.
height
,
bgNode_A
.
width
)
}
}
initTheme
()
{
let
themeType
=
this
.
g_formData
.
theme
;
let
videoTheme_A
=
this
.
g_cartoon
.
getCartoonElement
(
"
videoTheme_A
"
)
// let videoTheme_B = this.g_cartoon.getCartoonElement("videoTheme_B")
// let videoTheme_C = this.g_cartoon.getCartoonElement("videoTheme_C")
let
videoTheme_D
=
this
.
g_cartoon
.
getCartoonElement
(
"
videoTheme_D
"
)
let
textTheme_A
=
this
.
g_cartoon
.
getCartoonElement
(
"
textTheme_A
"
)
// let textTheme_B = this.g_cartoon.getCartoonElement("textTheme_B")
// let textTheme_C = this.g_cartoon.getCartoonElement("textTheme_C")
let
textTheme_D
=
this
.
g_cartoon
.
getCartoonElement
(
"
textTheme_D
"
)
switch
(
themeType
)
{
case
"
A
"
:
videoTheme_A
.
node
.
active
=
true
;
// videoTheme_B.node.active = false;
// videoTheme_C.node.active = false;
videoTheme_D
.
node
.
active
=
false
;
textTheme_A
.
node
.
active
=
true
;
// textTheme_B.node.active = false;
// textTheme_C.node.active = false;
textTheme_D
.
node
.
active
=
false
;
break
;
case
"
B
"
:
videoTheme_A
.
node
.
active
=
false
;
// videoTheme_B.node.active = true;
// videoTheme_C.node.active = false;
videoTheme_D
.
node
.
active
=
false
;
textTheme_A
.
node
.
active
=
false
;
// textTheme_B.node.active = true;
// textTheme_C.node.active = false;
textTheme_D
.
node
.
active
=
false
;
break
;
case
"
C
"
:
videoTheme_A
.
node
.
active
=
false
;
// videoTheme_B.node.active = false;
// videoTheme_C.node.active = true;
videoTheme_D
.
node
.
active
=
false
;
textTheme_A
.
node
.
active
=
false
;
// textTheme_B.node.active = false;
// textTheme_C.node.active = true;
textTheme_D
.
node
.
active
=
false
;
break
;
case
"
D
"
:
this
.
getSpriteFrimeByUrl
(
this
.
g_formData
.
video_image_url
).
then
(
sf
=>
{
if
(
videoTheme_D
.
node
.
getComponent
(
cc
.
Sprite
))
{
videoTheme_D
.
node
.
removeComponent
(
cc
.
Sprite
)
}
videoTheme_D
.
node
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
videoTheme_D
.
node
.
active
=
true
;
}).
catch
(
err
=>
{
console
.
log
(
err
)
videoTheme_A
.
node
.
active
=
true
;
videoTheme_D
.
node
.
active
=
false
;
})
this
.
getSpriteFrimeByUrl
(
this
.
g_formData
.
text_image_url
).
then
(
sf
=>
{
if
(
textTheme_D
.
node
.
getComponent
(
cc
.
Sprite
))
{
textTheme_D
.
node
.
removeComponent
(
cc
.
Sprite
)
}
textTheme_D
.
node
.
getComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
textTheme_D
.
node
.
active
=
true
;
}).
catch
(
err
=>
{
console
.
log
(
err
)
textTheme_A
.
node
.
active
=
true
;
textTheme_D
.
node
.
active
=
false
;
})
videoTheme_A
.
node
.
active
=
false
;
// videoTheme_B.node.active = false;
// videoTheme_C.node.active = false;
videoTheme_D
.
node
.
active
=
false
;
textTheme_A
.
node
.
active
=
false
;
// textTheme_B.node.active = false;
// textTheme_C.node.active = false;
textTheme_D
.
node
.
active
=
false
;
default
:;
}
}
playCurrentQuestion
()
{
playCurrentQuestion
()
{
let
rightDragon
=
this
.
g_cartoon
.
getCartoonElement
(
"
rightDragonContainer
"
)
let
rightDragon
=
this
.
g_cartoon
.
getCartoonElement
(
"
rightDragonContainer
"
)
var
container
=
this
.
g_cartoon
.
getCartoonElement
(
"
video_container_video
"
)
var
container
=
this
.
g_cartoon
.
getCartoonElement
(
"
video_container_video
"
)
...
@@ -290,7 +386,7 @@ export default class GameLogic {
...
@@ -290,7 +386,7 @@ export default class GameLogic {
const
parentNode
=
this
.
g_cartoon
.
getNodeByPath
(
"
MaskLayer
"
)
const
parentNode
=
this
.
g_cartoon
.
getNodeByPath
(
"
MaskLayer
"
)
parentNode
.
x
=
cc
.
winSize
.
width
/
2
parentNode
.
x
=
cc
.
winSize
.
width
/
2
parentNode
.
y
=
cc
.
winSize
.
height
/
2
parentNode
.
y
=
cc
.
winSize
.
height
/
2
const
bNode
=
this
.
getSprNode
(
'
black
'
);
const
bNode
=
this
.
getSprNode
ByResName
(
'
black
'
);
bNode
.
scaleX
=
cc
.
winSize
.
width
/
bNode
.
width
;
bNode
.
scaleX
=
cc
.
winSize
.
width
/
bNode
.
width
;
bNode
.
scaleY
=
cc
.
winSize
.
height
/
bNode
.
height
;
bNode
.
scaleY
=
cc
.
winSize
.
height
/
bNode
.
height
;
bNode
.
x
=
0
bNode
.
x
=
0
...
@@ -330,13 +426,21 @@ export default class GameLogic {
...
@@ -330,13 +426,21 @@ export default class GameLogic {
// Common API
// Common API
getSpriteFrimeByUrl
(
url
,
cb
)
{
getSpriteFrimeByUrl
(
url
)
{
cc
.
assetManager
.
loadRemote
(
url
,
(
err
,
img
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
spriteFrame
=
new
cc
.
SpriteFrame
(
img
)
if
(
!
url
)
{
if
(
cb
)
{
reject
()
cb
(
spriteFrame
);
}
else
{
}
cc
.
assetManager
.
loadRemote
(
url
,
(
err
,
img
)
=>
{
})
if
(
err
)
{
reject
(
err
)
}
else
{
const
spriteFrame
=
new
cc
.
SpriteFrame
(
img
)
resolve
(
spriteFrame
)
}
})
}
})
}
}
getSpriteFrimeByResName
(
name
)
{
getSpriteFrimeByResName
(
name
)
{
...
@@ -346,7 +450,18 @@ export default class GameLogic {
...
@@ -346,7 +450,18 @@ export default class GameLogic {
return
sf
;
return
sf
;
}
}
getSprNode
(
resName
)
{
getSprNodeByUrl
(
resName
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cc
.
assetManager
.
loadRemote
(
url
,
(
err
,
img
)
=>
{
const
node
=
new
cc
.
Node
();
const
spriteFrame
=
new
cc
.
SpriteFrame
(
img
)
node
.
addComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
resolve
(
node
)
})
})
}
getSprNodeByResName
(
resName
)
{
const
sf
=
cc
.
find
(
'
Canvas/res/img/
'
+
resName
).
getComponent
(
cc
.
Sprite
).
spriteFrame
;
const
sf
=
cc
.
find
(
'
Canvas/res/img/
'
+
resName
).
getComponent
(
cc
.
Sprite
).
spriteFrame
;
const
node
=
new
cc
.
Node
();
const
node
=
new
cc
.
Node
();
node
.
addComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
node
.
addComponent
(
cc
.
Sprite
).
spriteFrame
=
sf
;
...
...
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