Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP15
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
OP15
Commits
5de85225
Commit
5de85225
authored
Nov 25, 2021
by
liujiaxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: init
parent
4e17a6b5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
413 additions
and
188 deletions
+413
-188
form.component.html
form/src/app/form/form.component.html
+21
-1
form.component.ts
form/src/app/form/form.component.ts
+5
-4
play.component.ts
form/src/app/play/play.component.ts
+1
-1
OP15.fire
play/assets/OP15/scene/OP15.fire
+62
-69
scene.js
play/assets/OP15/scene/scene.js
+318
-107
bg.png.meta
play/assets/OP15/textures/bg.png.meta
+2
-2
m1.png.meta
play/assets/OP15/textures/m1.png.meta
+2
-2
m2.png.meta
play/assets/OP15/textures/m2.png.meta
+2
-2
No files found.
form/src/app/form/form.component.html
View file @
5de85225
<div
class=
"model-content"
>
<div
class=
"model-content"
>
<div
style=
"padding: 10px;"
>
<div
style=
"padding: 10px;"
>
<div
style=
"margin-top: 5px"
>
<span>
开头音频:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
begin_audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
begin_audio
')"
></app-audio-recorder>
</div>
<div
style=
"margin-top: 5px"
>
<span>
背景循环音频:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
playing_audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
playing_audio
')"
></app-audio-recorder>
</div>
<div
style=
"margin-top: 5px"
>
<span>
结尾音频:
</span>
<app-audio-recorder
[
audioUrl
]="
item
.
end_audio
"
(
audioUploaded
)="
onAudioUploadSuccess
($
event
,
'
end_audio
')"
></app-audio-recorder>
</div>
<h2>
热区配置:
</h2>
<h2>
热区配置:
</h2>
<app-custom-hot-zone
<app-custom-hot-zone
[
bgItem
]="
item
.
bgItem
"
[
bgItem
]="
item
.
bgItem
"
...
...
form/src/app/form/form.component.ts
View file @
5de85225
...
@@ -10,21 +10,22 @@ import { JsonPipe } from '@angular/common';
...
@@ -10,21 +10,22 @@ import { JsonPipe } from '@angular/common';
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
export
class
FormComponent
implements
OnInit
,
OnChanges
,
OnDestroy
{
// 储存数据用
// 储存数据用
saveKey
=
"
test_001
"
;
saveKey
=
'
test_op15
'
;
// 储存对象
// 储存对象
item
;
item
;
customTypeGroupArr
=
[
customTypeGroupArr
=
[
{
{
name
:
'
轮播图片
'
,
name
:
'
动画
'
,
anima
:
true
,
anima
:
true
,
//
audio: true,
audio
:
true
,
// pic: true,
// pic: true,
rect
:
true
,
rect
:
true
,
// text: true,
// isShowPos: true,
// isShowPos: true,
// isCopy: true,
// isCopy: true,
// label: '比对
',
label
:
'
开始提示时间点
'
,
},
},
];
];
saveHotZone
(
group
,
e
)
{
saveHotZone
(
group
,
e
)
{
...
...
form/src/app/play/play.component.ts
View file @
5de85225
...
@@ -57,7 +57,7 @@ export class PlayComponent implements OnInit, OnDestroy {
...
@@ -57,7 +57,7 @@ export class PlayComponent implements OnInit, OnDestroy {
canvasLeft
;
canvasLeft
;
canvasTop
;
canvasTop
;
saveKey
=
'
test_
0011
'
;
saveKey
=
'
test_
op15
'
;
btnLeft
;
btnLeft
;
...
...
play/assets/OP15/scene/OP15.fire
View file @
5de85225
...
@@ -923,7 +923,7 @@
...
@@ -923,7 +923,7 @@
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 18
"__id__": 18
...
@@ -952,15 +952,15 @@
...
@@ -952,15 +952,15 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
1
68.94
6,
1
45.32
6,
1
51.208
,
1
33.912
,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
0.2
5
,
0.2
2
,
0.2
5
,
0.2
2
,
0.25
0.25
]
]
},
},
...
@@ -1019,13 +1019,13 @@
...
@@ -1019,13 +1019,13 @@
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
apple
",
"_name": "
cow
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 20
"__id__": 20
...
@@ -1042,8 +1042,8 @@
...
@@ -1042,8 +1042,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
799
,
"width":
490
,
"height":
565
"height":
373
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -1077,7 +1077,7 @@
...
@@ -1077,7 +1077,7 @@
"_is3DNode": false,
"_is3DNode": false,
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"_id": "
a4xySIvblKnYP3MSugLg2o
"
"_id": "
32TEJDnbhMN7KT3gByoG4t
"
},
},
{
{
"__type__": "dragonBones.ArmatureDisplay",
"__type__": "dragonBones.ArmatureDisplay",
...
@@ -1098,7 +1098,7 @@
...
@@ -1098,7 +1098,7 @@
"_cacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"playTimes": -1,
"premultipliedAlpha": false,
"premultipliedAlpha": false,
"_armatureKey": "
4d85228f-ec02-4cbe-a0d8-cc8628fe805d#146d0d76-3625-438b-a6c8-dbd27ca2af6
3",
"_armatureKey": "
ff8e808c-0f2c-437d-93a2-e427b8036108#e49a7f11-180e-464a-b737-4100c50c529
3",
"_accTime": 0,
"_accTime": 0,
"_playCount": 0,
"_playCount": 0,
"_frameCache": null,
"_frameCache": null,
...
@@ -1106,10 +1106,10 @@
...
@@ -1106,10 +1106,10 @@
"_playing": false,
"_playing": false,
"_armatureCache": null,
"_armatureCache": null,
"_N$dragonAsset": {
"_N$dragonAsset": {
"__uuid__": "
4d85228f-ec02-4cbe-a0d8-cc8628fe805d
"
"__uuid__": "
ff8e808c-0f2c-437d-93a2-e427b8036108
"
},
},
"_N$dragonAtlasAsset": {
"_N$dragonAtlasAsset": {
"__uuid__": "
146d0d76-3625-438b-a6c8-dbd27ca2af6
3"
"__uuid__": "
e49a7f11-180e-464a-b737-4100c50c529
3"
},
},
"_N$_defaultArmatureIndex": 0,
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
"_N$_animationIndex": 0,
...
@@ -1117,17 +1117,17 @@
...
@@ -1117,17 +1117,17 @@
"_N$timeScale": 1,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$debugBones": false,
"_N$enableBatch": false,
"_N$enableBatch": false,
"_id": "
552Xm8CDxMpIOVobC+Q//U
"
"_id": "
13p+CDbYxKh6Neq43ZxC7X
"
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
bird
",
"_name": "
apple
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 22
"__id__": 22
...
@@ -1144,8 +1144,8 @@
...
@@ -1144,8 +1144,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
214
,
"width":
799
,
"height":
171
"height":
565
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -1179,7 +1179,7 @@
...
@@ -1179,7 +1179,7 @@
"_is3DNode": false,
"_is3DNode": false,
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"_id": "
9aJcXS8bdKj47wtsfNhmXs
"
"_id": "
a4xySIvblKnYP3MSugLg2o
"
},
},
{
{
"__type__": "dragonBones.ArmatureDisplay",
"__type__": "dragonBones.ArmatureDisplay",
...
@@ -1200,7 +1200,7 @@
...
@@ -1200,7 +1200,7 @@
"_cacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"playTimes": -1,
"premultipliedAlpha": false,
"premultipliedAlpha": false,
"_armatureKey": "
c09e0f09-3dcd-48ab-96e9-b3411b332e30#f7c2a4ed-1ea1-47fa-af1a-b0a87503411a
",
"_armatureKey": "
4d85228f-ec02-4cbe-a0d8-cc8628fe805d#146d0d76-3625-438b-a6c8-dbd27ca2af63
",
"_accTime": 0,
"_accTime": 0,
"_playCount": 0,
"_playCount": 0,
"_frameCache": null,
"_frameCache": null,
...
@@ -1208,10 +1208,10 @@
...
@@ -1208,10 +1208,10 @@
"_playing": false,
"_playing": false,
"_armatureCache": null,
"_armatureCache": null,
"_N$dragonAsset": {
"_N$dragonAsset": {
"__uuid__": "
c09e0f09-3dcd-48ab-96e9-b3411b332e30
"
"__uuid__": "
4d85228f-ec02-4cbe-a0d8-cc8628fe805d
"
},
},
"_N$dragonAtlasAsset": {
"_N$dragonAtlasAsset": {
"__uuid__": "
f7c2a4ed-1ea1-47fa-af1a-b0a87503411a
"
"__uuid__": "
146d0d76-3625-438b-a6c8-dbd27ca2af63
"
},
},
"_N$_defaultArmatureIndex": 0,
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
"_N$_animationIndex": 0,
...
@@ -1219,17 +1219,17 @@
...
@@ -1219,17 +1219,17 @@
"_N$timeScale": 1,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$debugBones": false,
"_N$enableBatch": false,
"_N$enableBatch": false,
"_id": "
04F4O9iptO77MTN5BpBjLp
"
"_id": "
552Xm8CDxMpIOVobC+Q//U
"
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
car
",
"_name": "
bird
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 24
"__id__": 24
...
@@ -1246,8 +1246,8 @@
...
@@ -1246,8 +1246,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
3
14,
"width":
2
14,
"height": 17
5
"height": 17
1
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -1281,7 +1281,7 @@
...
@@ -1281,7 +1281,7 @@
"_is3DNode": false,
"_is3DNode": false,
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"_id": "
58za+HBcxMWJ6BCVXzaDJ9
"
"_id": "
9aJcXS8bdKj47wtsfNhmXs
"
},
},
{
{
"__type__": "dragonBones.ArmatureDisplay",
"__type__": "dragonBones.ArmatureDisplay",
...
@@ -1302,7 +1302,7 @@
...
@@ -1302,7 +1302,7 @@
"_cacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"playTimes": -1,
"premultipliedAlpha": false,
"premultipliedAlpha": false,
"_armatureKey": "
927c2190-9931-4948-bc8f-f93273d386f1#cb558b4f-c46d-4597-be52-2a01e9919a07
",
"_armatureKey": "
c09e0f09-3dcd-48ab-96e9-b3411b332e30#f7c2a4ed-1ea1-47fa-af1a-b0a87503411a
",
"_accTime": 0,
"_accTime": 0,
"_playCount": 0,
"_playCount": 0,
"_frameCache": null,
"_frameCache": null,
...
@@ -1310,10 +1310,10 @@
...
@@ -1310,10 +1310,10 @@
"_playing": false,
"_playing": false,
"_armatureCache": null,
"_armatureCache": null,
"_N$dragonAsset": {
"_N$dragonAsset": {
"__uuid__": "
927c2190-9931-4948-bc8f-f93273d386f1
"
"__uuid__": "
c09e0f09-3dcd-48ab-96e9-b3411b332e30
"
},
},
"_N$dragonAtlasAsset": {
"_N$dragonAtlasAsset": {
"__uuid__": "
cb558b4f-c46d-4597-be52-2a01e9919a07
"
"__uuid__": "
f7c2a4ed-1ea1-47fa-af1a-b0a87503411a
"
},
},
"_N$_defaultArmatureIndex": 0,
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
"_N$_animationIndex": 0,
...
@@ -1321,17 +1321,17 @@
...
@@ -1321,17 +1321,17 @@
"_N$timeScale": 1,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$debugBones": false,
"_N$enableBatch": false,
"_N$enableBatch": false,
"_id": "
25dK2Sp95JZLKy6DBkvVC2
"
"_id": "
04F4O9iptO77MTN5BpBjLp
"
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "ca
t
",
"_name": "ca
r
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 26
"__id__": 26
...
@@ -1348,8 +1348,8 @@
...
@@ -1348,8 +1348,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
451
,
"width":
314
,
"height":
489
"height":
175
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -1383,7 +1383,7 @@
...
@@ -1383,7 +1383,7 @@
"_is3DNode": false,
"_is3DNode": false,
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"_id": "
65ayr7TKxHAag/Ti4Xmp+i
"
"_id": "
58za+HBcxMWJ6BCVXzaDJ9
"
},
},
{
{
"__type__": "dragonBones.ArmatureDisplay",
"__type__": "dragonBones.ArmatureDisplay",
...
@@ -1404,7 +1404,7 @@
...
@@ -1404,7 +1404,7 @@
"_cacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"playTimes": -1,
"premultipliedAlpha": false,
"premultipliedAlpha": false,
"_armatureKey": "
0d98c5c3-f6ce-4b53-8b13-3f64793c6c2a#6f320da8-7ad6-4576-9ed9-9f008f467cf
7",
"_armatureKey": "
927c2190-9931-4948-bc8f-f93273d386f1#cb558b4f-c46d-4597-be52-2a01e9919a0
7",
"_accTime": 0,
"_accTime": 0,
"_playCount": 0,
"_playCount": 0,
"_frameCache": null,
"_frameCache": null,
...
@@ -1412,10 +1412,10 @@
...
@@ -1412,10 +1412,10 @@
"_playing": false,
"_playing": false,
"_armatureCache": null,
"_armatureCache": null,
"_N$dragonAsset": {
"_N$dragonAsset": {
"__uuid__": "
0d98c5c3-f6ce-4b53-8b13-3f64793c6c2a
"
"__uuid__": "
927c2190-9931-4948-bc8f-f93273d386f1
"
},
},
"_N$dragonAtlasAsset": {
"_N$dragonAtlasAsset": {
"__uuid__": "
6f320da8-7ad6-4576-9ed9-9f008f467cf
7"
"__uuid__": "
cb558b4f-c46d-4597-be52-2a01e9919a0
7"
},
},
"_N$_defaultArmatureIndex": 0,
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
"_N$_animationIndex": 0,
...
@@ -1423,17 +1423,17 @@
...
@@ -1423,17 +1423,17 @@
"_N$timeScale": 1,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$debugBones": false,
"_N$enableBatch": false,
"_N$enableBatch": false,
"_id": "2
4iVKgQhhEqoFPGYtXW6yO
"
"_id": "2
5dK2Sp95JZLKy6DBkvVC2
"
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "c
ow
",
"_name": "c
at
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 28
"__id__": 28
...
@@ -1450,8 +1450,8 @@
...
@@ -1450,8 +1450,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 4
90
,
"width": 4
51
,
"height":
373
"height":
489
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -1485,7 +1485,7 @@
...
@@ -1485,7 +1485,7 @@
"_is3DNode": false,
"_is3DNode": false,
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"_id": "
32TEJDnbhMN7KT3gByoG4t
"
"_id": "
65ayr7TKxHAag/Ti4Xmp+i
"
},
},
{
{
"__type__": "dragonBones.ArmatureDisplay",
"__type__": "dragonBones.ArmatureDisplay",
...
@@ -1506,7 +1506,7 @@
...
@@ -1506,7 +1506,7 @@
"_cacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"playTimes": -1,
"premultipliedAlpha": false,
"premultipliedAlpha": false,
"_armatureKey": "
ff8e808c-0f2c-437d-93a2-e427b8036108#e49a7f11-180e-464a-b737-4100c50c5293
",
"_armatureKey": "
0d98c5c3-f6ce-4b53-8b13-3f64793c6c2a#6f320da8-7ad6-4576-9ed9-9f008f467cf7
",
"_accTime": 0,
"_accTime": 0,
"_playCount": 0,
"_playCount": 0,
"_frameCache": null,
"_frameCache": null,
...
@@ -1514,10 +1514,10 @@
...
@@ -1514,10 +1514,10 @@
"_playing": false,
"_playing": false,
"_armatureCache": null,
"_armatureCache": null,
"_N$dragonAsset": {
"_N$dragonAsset": {
"__uuid__": "
ff8e808c-0f2c-437d-93a2-e427b8036108
"
"__uuid__": "
0d98c5c3-f6ce-4b53-8b13-3f64793c6c2a
"
},
},
"_N$dragonAtlasAsset": {
"_N$dragonAtlasAsset": {
"__uuid__": "
e49a7f11-180e-464a-b737-4100c50c5293
"
"__uuid__": "
6f320da8-7ad6-4576-9ed9-9f008f467cf7
"
},
},
"_N$_defaultArmatureIndex": 0,
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
"_N$_animationIndex": 0,
...
@@ -1525,7 +1525,7 @@
...
@@ -1525,7 +1525,7 @@
"_N$timeScale": 1,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$debugBones": false,
"_N$enableBatch": false,
"_N$enableBatch": false,
"_id": "
13p+CDbYxKh6Neq43ZxC7X
"
"_id": "
24iVKgQhhEqoFPGYtXW6yO
"
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
...
@@ -1535,7 +1535,7 @@
...
@@ -1535,7 +1535,7 @@
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 30
"__id__": 30
...
@@ -1637,7 +1637,7 @@
...
@@ -1637,7 +1637,7 @@
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 32
"__id__": 32
...
@@ -1739,7 +1739,7 @@
...
@@ -1739,7 +1739,7 @@
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 34
"__id__": 34
...
@@ -1841,7 +1841,7 @@
...
@@ -1841,7 +1841,7 @@
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 36
"__id__": 36
...
@@ -1943,7 +1943,7 @@
...
@@ -1943,7 +1943,7 @@
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 38
"__id__": 38
...
@@ -2045,7 +2045,7 @@
...
@@ -2045,7 +2045,7 @@
"__id__": 14
"__id__": 14
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 40
"__id__": 40
...
@@ -3433,19 +3433,12 @@
...
@@ -3433,19 +3433,12 @@
"__id__": 2
"__id__": 2
},
},
"_enabled": true,
"_enabled": true,
"ant": null,
"rightAudio": {
"apple": null,
"__uuid__": "17e37c00-52ee-45df-9795-d534124a9d06"
"bird": null,
},
"car": null,
"wrongAudio": {
"cat": null,
"__uuid__": "73a669bb-5d2b-4085-a40c-3a5d4564e32c"
"cow": null,
},
"duck": null,
"egg": null,
"farmer": null,
"fish": null,
"girl": null,
"hen": null,
"house": null,
"_id": "e687yyoRBIzZAOVRL8Sseh"
"_id": "e687yyoRBIzZAOVRL8Sseh"
}
}
]
]
\ No newline at end of file
play/assets/OP15/scene/scene.js
View file @
5de85225
import
{
onHomeworkFinish
,
RandomInt
,
playAudioByUrl
}
from
"
../script/util
"
;
import
{
onHomeworkFinish
,
RandomInt
,
playAudioByUrl
,
loadDragonBones
}
from
"
../script/util
"
;
import
{
defaultData
}
from
"
../script/defaultData
"
;
import
{
defaultData
}
from
"
../script/defaultData
"
;
import
{
assign
,
createMachine
,
interpret
,
actions
,
forwardTo
}
from
"
../script/xstate
"
;
import
{
assign
,
createMachine
,
interpret
,
actions
,
forwardTo
,
matchesState
}
from
"
../script/xstate
"
;
const
{
pure
,
send
,
raise
}
=
actions
;
const
{
pure
,
send
,
raise
,
sendParent
}
=
actions
;
class
AssetCacher
{
class
AssetCacher
{
constructor
(
data
,
progress
,
complete
)
{
constructor
(
data
,
progress
,
complete
)
{
...
@@ -75,7 +75,7 @@ cc.Class({
...
@@ -75,7 +75,7 @@ cc.Class({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
properties
:
{
properties
:
{
ant
:
{
/*
ant: {
default: null,
default: null,
type: cc.Node,
type: cc.Node,
},
},
...
@@ -126,16 +126,23 @@ cc.Class({
...
@@ -126,16 +126,23 @@ cc.Class({
house: {
house: {
default: null,
default: null,
type: cc.Node,
type: cc.Node,
},*/
rightAudio
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
},
wrongAudio
:
{
default
:
null
,
type
:
cc
.
AudioClip
,
},
},
},
},
playAni
(
node
,
name
,
times
=
1
)
{
playAni
(
idx
,
name
,
times
=
1
)
{
const
cat
=
cc
.
find
(
`Canvas/frame-border/ground/
${
node
}
`
);
//
const cat = cc.find(`Canvas/frame-border/ground/${node}`);
const
node
=
this
.
_animaNodeList
[
idx
]
var
dragonDisplay
=
cat
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
var
dragonDisplay
=
node
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
state
=
dragonDisplay
.
playAnimation
(
name
,
times
);
const
state
=
dragonDisplay
.
playAnimation
(
name
,
times
);
return
state
;
return
state
;
...
@@ -150,10 +157,17 @@ cc.Class({
...
@@ -150,10 +157,17 @@ cc.Class({
_imageResList
:
null
,
_imageResList
:
null
,
_audioResList
:
null
,
_audioResList
:
null
,
_animaResList
:
null
,
_animaResList
:
null
,
_animaNodeList
:
null
,
_lastFingerPosition
:
null
,
initSceneData
()
{
initSceneData
()
{
this
.
_imageResList
=
[];
this
.
_imageResList
=
[];
this
.
_audioResList
=
[];
this
.
_audioResList
=
[];
this
.
_animaResList
=
[];
this
.
_animaResList
=
[];
this
.
_animaNodeList
=
[];
this
.
_lastFingerPosition
=
{
pos
:
null
,
dirty
:
false
};
},
},
_designSize
:
null
,
// 设计分辨率
_designSize
:
null
,
// 设计分辨率
...
@@ -161,6 +175,7 @@ cc.Class({
...
@@ -161,6 +175,7 @@ cc.Class({
_mapScaleMin
:
null
,
// 场景中常用缩放(取大值)
_mapScaleMin
:
null
,
// 场景中常用缩放(取大值)
_mapScaleMax
:
null
,
// 场景中常用缩放(取小值)
_mapScaleMax
:
null
,
// 场景中常用缩放(取小值)
_cocosScale
:
null
,
// cocos 自缩放 (较少用到)
_cocosScale
:
null
,
// cocos 自缩放 (较少用到)
initSize
()
{
initSize
()
{
// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
// 注意cc.winSize只有在适配后(修改fitHeight/fitWidth后)才能获取到正确的值,因此使用cc.getFrameSize()来获取初始的屏幕大小
let
screen_size
=
cc
.
view
.
getFrameSize
().
width
/
cc
.
view
.
getFrameSize
().
height
let
screen_size
=
cc
.
view
.
getFrameSize
().
width
/
cc
.
view
.
getFrameSize
().
height
...
@@ -199,11 +214,10 @@ cc.Class({
...
@@ -199,11 +214,10 @@ cc.Class({
hint
:
{
hint
:
{
invoke
:
{
invoke
:
{
src
:
(
ctx
,
event
)
=>
{
src
:
(
ctx
,
event
)
=>
{
const
rt
=
RandomInt
(
3000
,
5000
);
console
.
log
(
`[hint] play question
${
ctx
.
questionIndex
}
:
${
ctx
.
questionPlayTimes
}
audio`
);
console
.
log
(
`[hint] play question
${
ctx
.
questionIndex
}
:
${
ctx
.
questionPlayTimes
}
audio
${
rt
}
`
);
ctx
.
questionPlayTimes
+=
1
;
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
playAudioByUrl
(
this
.
data
.
playing_questions
[
ctx
.
questionIndex
].
hint_audio
,
()
=>
{
playAudioByUrl
(
this
.
data
.
hotZoneItemArr
[
ctx
.
questionIndex
].
audio_url
,
()
=>
{
console
.
log
(
'
hint finish
'
);
console
.
log
(
'
hint finish
'
);
resolve
()
resolve
()
})
})
...
@@ -215,7 +229,7 @@ cc.Class({
...
@@ -215,7 +229,7 @@ cc.Class({
},
},
answer
:
{
answer
:
{
after
:
{
after
:
{
5
000
:
[
10
000
:
[
{
{
target
:
'
#QuestionsArray.next
'
,
target
:
'
#QuestionsArray.next
'
,
actions
:
raise
(
'
CHECK
'
),
actions
:
raise
(
'
CHECK
'
),
...
@@ -230,7 +244,7 @@ cc.Class({
...
@@ -230,7 +244,7 @@ cc.Class({
},
},
invoke
:
{
invoke
:
{
src
:
(
ctx
)
=>
{
/*
src: (ctx) => {
ctx.questionPlayTimes += 1;
ctx.questionPlayTimes += 1;
const rt = RandomInt(4500, 5500)
const rt = RandomInt(4500, 5500)
console.log('[answer] thinking and playing', rt, rt<5000 ? 'should 1111': '');
console.log('[answer] thinking and playing', rt, rt<5000 ? 'should 1111': '');
...
@@ -247,23 +261,127 @@ cc.Class({
...
@@ -247,23 +261,127 @@ cc.Class({
}, rt)
}, rt)
})
})
},
},
onDone: {
onDone: {
target: '#QuestionsArray.next',
target: '#QuestionsArray.next',
actions: raise('CHECK')
actions: raise('CHECK')
},
},
onError: {
onError: {
target: 'retry',
target: 'retry',
actions: raise('CHECK')
actions: raise('CHECK')
},*/
src
:
(
context
,
event
)
=>
(
callback
,
onReceive
)
=>
{
console
.
log
(
'
[answer] thinking and playing
'
);
// This will send the 'INC' event to the parent every second
const
id
=
setInterval
(()
=>
{
const
region
=
this
.
data
.
hotZoneItemArr
[
context
.
questionIndex
];
const
result
=
this
.
checkInRegion
(
region
.
rectPercent
);
console
.
log
(
'
checkInRegion
'
,
region
.
rectPercent
,
result
);
if
(
result
)
{
callback
(
'
RIGHT
'
)
// playAudioByUrl(this.data.begin_audio, () => {
// console.log('game begin audio finish');
// })
}
else
if
(
this
.
_lastFingerPosition
.
dirty
)
{
callback
(
'
WRONG
'
)
}
},
1000
);
// Perform cleanup
return
()
=>
clearInterval
(
id
);
},
},
on
:
{
/*CHECK: {
actions: (context, evt) => {
const region = this.data.hotZoneItemArr[context.questionIndex];
const result = this.checkInRegion(region.rectPercent);
console.log('checkInRegion', region.rectPercent, result);
if (result) {
// forwardTo('RIGHT')
send({type: 'RIGHT' });
}
}
},*/
/*CHECK: [
{
actions: send('RIGHT'),
cond: (context, evt) => {
const region = this.data.hotZoneItemArr[context.questionIndex];
const result = this.checkInRegion(region.rectPercent);
console.log('checkInRegion', region.rectPercent, result);
if (result) {
// forwardTo('RIGHT')
send({type: 'RIGHT' });
}
}
},
{actions: raise('WRONG')},
],*/
/*RIGHT: {
target: '#QuestionsArray.next',
actions: raise('CHECK')
},
WRONG: {
target: 'retry',
actions: raise('CHECK')
}*/
RIGHT
:
{
target
:
'
right
'
,
},
WRONG
:
{
target
:
'
wrong
'
,
}
}
},
right
:
{
invoke
:
{
src
:
(
context
,
event
)
=>
{
this
.
_lastFingerPosition
.
pos
=
null
;
this
.
_lastFingerPosition
.
dirty
=
false
;
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
'
answer right
'
);
playAudioByUrl
(
this
.
rightAudio
,
()
=>
{
resolve
()
})
});
},
onDone
:
{
target
:
'
#QuestionsArray.next
'
,
actions
:
raise
(
'
CHECK
'
)
},
onError
:
{
target
:
'
#QuestionsArray.next
'
,
actions
:
raise
(
'
CHECK
'
)
}
}
},
wrong
:{
invoke
:
{
src
:
(
context
,
event
)
=>
{
this
.
_lastFingerPosition
.
pos
=
null
;
this
.
_lastFingerPosition
.
dirty
=
false
;
return
new
Promise
((
resolve
,
reject
)
=>
{
console
.
log
(
'
answer wrong
'
);
playAudioByUrl
(
this
.
wrongAudio
,
()
=>
{
resolve
()
})
});
},
onDone
:
{
target
:
'
retry
'
,
actions
:
raise
(
'
CHECK
'
)
},
onError
:
{
target
:
'
retry
'
,
actions
:
raise
(
'
CHECK
'
)
}
}
}
}
},
},
retry
:
{
retry
:
{
on
:
{
on
:
{
CHECK
:
[
CHECK
:
[
{
target
:
'
hint
'
},
{
target
:
'
hint
'
},
{
{
...
@@ -318,7 +436,7 @@ cc.Class({
...
@@ -318,7 +436,7 @@ cc.Class({
questionIndex
:
0
,
questionIndex
:
0
,
questionPlayTimes
:
0
,
questionPlayTimes
:
0
,
maxQuestionTryTimes
:
2
,
maxQuestionTryTimes
:
2
,
questionsCount
:
this
.
data
.
playing_questions
.
length
,
questionsCount
:
this
.
data
.
hotZoneItemArr
.
length
,
},
},
states
:
{
states
:
{
begin
:
{
begin
:
{
...
@@ -326,6 +444,9 @@ cc.Class({
...
@@ -326,6 +444,9 @@ cc.Class({
invoke
:
{
invoke
:
{
src
:
(
ctx
)
=>
{
src
:
(
ctx
)
=>
{
console
.
log
(
'
game begin
'
);
console
.
log
(
'
game begin
'
);
if
(
window
.
air
&&
window
.
air
.
openOsmoFingerRead
)
{
window
.
air
.
openOsmoFingerRead
()
}
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
playAudioByUrl
(
this
.
data
.
begin_audio
,
()
=>
{
playAudioByUrl
(
this
.
data
.
begin_audio
,
()
=>
{
console
.
log
(
'
game begin audio finish
'
);
console
.
log
(
'
game begin audio finish
'
);
...
@@ -358,9 +479,12 @@ cc.Class({
...
@@ -358,9 +479,12 @@ cc.Class({
entry
:
(
ctx
,
event
)
=>
{
entry
:
(
ctx
,
event
)
=>
{
console
.
log
(
'
game end
'
,
ctx
,
event
);
console
.
log
(
'
game end
'
,
ctx
,
event
);
cc
.
assetManager
.
loadRemote
(
this
.
data
.
playing_audio
,
(
err
,
audioClip
)
=>
{
if
(
window
.
air
&&
window
.
air
.
closeOsmoFingerRead
)
{
cc
.
audioEngine
.
playMusic
(
audioClip
,
true
,
0.8
);
window
.
air
.
closeOsmoFingerRead
()
});
}
playAudioByUrl
(
this
.
data
.
end_audio
,
()
=>
{
console
.
log
(
'
game finish
'
);
})
// return new Promise((resolve,reject) => {
// return new Promise((resolve,reject) => {
// setTimeout(() => {
// setTimeout(() => {
// console.log('hint finish');
// console.log('hint finish');
...
@@ -373,12 +497,13 @@ cc.Class({
...
@@ -373,12 +497,13 @@ cc.Class({
}
}
};
};
const
after
=
{};
const
after
=
{};
for
(
const
t
of
this
.
data
.
begin_time_point
)
{
for
(
let
i
=
0
;
i
<
this
.
data
.
hotZoneItemArr
.
length
;
i
++
)
{
const
k
=
t
.
time
*
1000
;
const
t
=
this
.
data
.
hotZoneItemArr
[
i
];
const
k
=
+
t
.
labelText
*
1000
;
after
[
k
]
=
{
after
[
k
]
=
{
actions
:
()
=>
{
actions
:
()
=>
{
console
.
log
(
k
)
console
.
log
(
k
)
this
.
playAni
(
t
.
node
,
t
.
name
)
this
.
playAni
(
i
,
'
normal
'
)
}
}
}
}
}
}
...
@@ -410,11 +535,75 @@ cc.Class({
...
@@ -410,11 +535,75 @@ cc.Class({
console
.
log
(
'
data:
'
,
data
);
console
.
log
(
'
data:
'
,
data
);
this
.
data
=
data
||
this
.
getDefaultData
();
this
.
data
=
data
||
this
.
getDefaultData
();
this
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
))
this
.
data
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
data
))
const
baseRect
=
this
.
data
.
bgItem
.
rect
;
this
.
data
.
hotZoneItemArr
.
forEach
(
block
=>
{
block
.
rectPercent
=
{
x
:
block
.
rect
.
x
/
baseRect
.
width
,
y
:
block
.
rect
.
y
/
baseRect
.
height
,
width
:
block
.
rect
.
width
/
baseRect
.
width
,
height
:
block
.
rect
.
height
/
baseRect
.
height
,
}
});
console
.
log
(
this
.
data
);
this
.
preloadItem
()
this
.
preloadItem
()
});
});
window
.
air
=
window
.
air
||
{}
if
(
window
.
air
)
{
window
.
air
.
osmoFingerReadCallback
=
(
pos
)
=>
{
if
(
this
.
gameMachineService
)
{
return
;
}
// const st = this.gameMachineService.state.value.constructor.name == 'Object'
// && this.gameMachineService.state.value['playing']
// && this.gameMachineService.state.value['playing'].constructor.name == 'Object'
// && this.gameMachineService.state.value['playing']['play']
// && this.gameMachineService.state.value['playing']['play'] == 'answer'
// if (st) {
// }
const
p
=
JSON
.
parse
(
pos
);
this
.
_lastFingerPosition
=
{
pos
:{
x
:
p
.
x
*
2
,
y
:
p
.
y
},
dirty
:
true
}
return
let
dirty
=
false
;
const
lp
=
this
.
_lastFingerPosition
;
const
p2
=
lp
.
pos
;
if
(
!
p2
)
{
lp
.
pos
=
{
x
:
p
.
x
*
2
,
y
:
p
.
y
};
lp
.
dirty
=
true
;
return
}
const
detlaX
=
Math
.
abs
(
p2
.
x
-
p
.
x
);
const
detlaY
=
Math
.
abs
(
p2
.
y
-
p
.
y
);
lp
.
pos
=
{
x
:
p
.
x
*
2
,
y
:
p
.
y
};
if
(
detlaX
<
0.05
&&
detlaY
<
0.05
)
{
lp
.
dirty
=
false
;
}
else
{
lp
.
dirty
=
true
;
}
}
}
},
checkInRegion
(
r
)
{
const
p
=
this
.
_lastFingerPosition
?
this
.
_lastFingerPosition
.
pos
||
{
x
:
0
,
y
:
0
}
:
{
x
:
0
,
y
:
0
};
const
w
=
p
.
x
>
r
.
x
&&
p
.
x
<
(
r
.
x
+
r
.
width
);
const
h
=
p
.
y
>
r
.
y
&&
p
.
y
<
(
r
.
y
+
r
.
height
);
return
w
&&
h
;
},
},
getData
(
func
)
{
getData
(
func
)
{
...
@@ -447,8 +636,11 @@ cc.Class({
...
@@ -447,8 +636,11 @@ cc.Class({
addPreloadImage
()
{
addPreloadImage
()
{
// this._imageResList.push({ url: this.data.pic_
url});
this
.
_imageResList
.
push
({
url
:
this
.
data
.
bgItem
.
url
});
// this._imageResList.push({ url: this.data.pic_url_2 });
// this._imageResList.push({ url: this.data.pic_url_2 });
for
(
const
q
of
this
.
data
.
hotZoneItemArr
)
{
this
.
_audioResList
.
push
({
url
:
q
.
texPngData
.
url
});
}
},
},
addPreloadAudio
()
{
addPreloadAudio
()
{
...
@@ -458,8 +650,8 @@ cc.Class({
...
@@ -458,8 +650,8 @@ cc.Class({
this
.
_audioResList
.
push
({
url
:
this
.
data
.
end_audio
});
this
.
_audioResList
.
push
({
url
:
this
.
data
.
end_audio
});
for
(
const
q
of
this
.
data
.
playing_questions
)
{
for
(
const
q
of
this
.
data
.
hotZoneItemArr
)
{
this
.
_audioResList
.
push
({
url
:
q
.
hint_audio
});
this
.
_audioResList
.
push
({
url
:
q
.
audio_url
});
}
}
},
},
...
@@ -475,17 +667,35 @@ cc.Class({
...
@@ -475,17 +667,35 @@ cc.Class({
// console.log(f, t, item)
// console.log(f, t, item)
},
(
err
,
data
)
=>
{
},
(
err
,
data
)
=>
{
console
.
log
(
err
,
data
);
console
.
log
(
err
,
data
);
for
(
const
asset
of
data
)
{
// for (const asset of data) {
if
(
asset
.
constructor
.
name
===
'
ImageBitmap
'
)
{
// if (asset.constructor.name === 'ImageBitmap') {
const
t
=
new
cc
.
Texture2D
()
// const t = new cc.Texture2D()
t
.
initWithData
(
asset
);
// t.initWithData(asset);
}
else
if
(
asset
.
constructor
.
name
===
'
AudioBuffer
'
)
{
// } else if (asset.constructor.name === 'AudioBuffer') {
const
clip
=
new
cc
.
AudioClip
()
// const clip = new cc.AudioClip()
clip
.
_nativeAsset
=
asset
;
// clip._nativeAsset = asset;
}
// }
// }
const
ground
=
cc
.
find
(
`Canvas/frame-border/ground`
);
for
(
const
zone
of
this
.
data
.
hotZoneItemArr
)
{
const
n
=
new
cc
.
Node
();
n
.
scale
=
0.25
;
const
db
=
n
.
addComponent
(
dragonBones
.
ArmatureDisplay
);
this
.
_animaNodeList
.
push
(
n
);
loadDragonBones
(
db
,
{
tex
:
zone
.
texPngData
.
url
,
atlas
:
zone
.
texJsonData
.
url
,
ske
:
zone
.
skeJsonData
.
url
,
}).
then
(({
width
,
height
})
=>
{
// v.armatureName = 'armature
n
.
width
=
width
;
n
.
height
=
height
;
n
.
parent
=
ground
});
}
}
this
.
loadEnd
();
this
.
loadEnd
();
if
(
window
&&
window
[
"
air
"
])
{
if
(
window
&&
window
[
"
air
"
]
&&
window
[
"
air
"
].
hideAirClassLoading
)
{
window
[
"
air
"
].
hideAirClassLoading
();
window
[
"
air
"
].
hideAirClassLoading
();
}
}
...
@@ -500,6 +710,7 @@ cc.Class({
...
@@ -500,6 +710,7 @@ cc.Class({
this
.
initView
();
this
.
initView
();
// this.initListener();
// this.initListener();
this
.
createStateMachine
();
this
.
createStateMachine
();
},
},
_cantouch
:
null
,
_cantouch
:
null
,
...
@@ -541,54 +752,54 @@ cc.Class({
...
@@ -541,54 +752,54 @@ cc.Class({
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
canvas
=
cc
.
find
(
'
Canvas
'
);
const
maxW
=
canvas
.
width
*
0.7
;
const
maxW
=
canvas
.
width
*
0.7
;
this
.
getSprNodeByUrl
(
this
.
data
.
pic_url
,
(
sprNode
)
=>
{
//
this.getSprNodeByUrl(this.data.pic_url, (sprNode) => {
const
picNode1
=
sprNode
;
//
const picNode1 = sprNode;
picNode1
.
scale
=
maxW
/
picNode1
.
width
;
//
picNode1.scale = maxW / picNode1.width;
picNode1
.
baseX
=
picNode1
.
x
;
//
picNode1.baseX = picNode1.x;
//
canvas.addChild(picNode1);
//
canvas.addChild(picNode1);
this
.
pic1
=
picNode1
;
//
this.pic1 = picNode1;
const
labelNode
=
new
cc
.
Node
();
//
const labelNode = new cc.Node();
labelNode
.
color
=
cc
.
Color
.
YELLOW
;
//
labelNode.color = cc.Color.YELLOW;
const
label
=
labelNode
.
addComponent
(
cc
.
Label
);
//
const label = labelNode.addComponent(cc.Label);
label
.
string
=
this
.
data
.
text
;
//
label.string = this.data.text;
label
.
fontSize
=
60
;
//
label.fontSize = 60;
label
.
lineHeight
=
60
;
//
label.lineHeight = 60;
label
.
font
=
cc
.
find
(
'
Canvas/res/font/BRLNSDB
'
).
getComponent
(
'
cc.Label
'
).
font
;
//
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent('cc.Label').font;
//
picNode1.addChild(labelNode);
//
picNode1.addChild(labelNode);
});
//
});
this
.
getSprNodeByUrl
(
this
.
data
.
pic_url_2
,
(
sprNode
)
=>
{
//
this.getSprNodeByUrl(this.data.pic_url_2, (sprNode) => {
const
picNode2
=
sprNode
;
//
const picNode2 = sprNode;
picNode2
.
scale
=
maxW
/
picNode2
.
width
;
//
picNode2.scale = maxW / picNode2.width;
canvas
.
addChild
(
picNode2
);
//
canvas.addChild(picNode2);
picNode2
.
x
=
canvas
.
width
;
//
picNode2.x = canvas.width;
picNode2
.
baseX
=
picNode2
.
x
;
//
picNode2.baseX = picNode2.x;
this
.
pic2
=
picNode2
;
//
this.pic2 = picNode2;
const
labelNode
=
new
cc
.
Node
();
//
const labelNode = new cc.Node();
const
label
=
labelNode
.
addComponent
(
cc
.
RichText
);
//
const label = labelNode.addComponent(cc.RichText);
const
size
=
60
//
const size = 60
label
.
font
=
cc
.
find
(
'
Canvas/res/font/BRLNSDB
'
).
getComponent
(
cc
.
Label
).
font
;
//
label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent(cc.Label).font;
label
.
string
=
`<outline color=#751e00 width=4><size=
${
size
}
><color=#ffffff>
${
this
.
data
.
text
}
</color></size></outline>`
//
label.string = `<outline color=#751e00 width=4><size=${size}><color=#ffffff>${this.data.text}</color></size></outline>`
label
.
lineHeight
=
size
;
//
label.lineHeight = size;
picNode2
.
addChild
(
labelNode
);
//
picNode2.addChild(labelNode);
});
//
});
},
},
initIcon
()
{
initIcon
()
{
const
iconNode
=
this
.
getSprNode
(
'
icon
'
);
//
const iconNode = this.getSprNode('icon');
iconNode
.
zIndex
=
5
;
//
iconNode.zIndex = 5;
iconNode
.
anchorX
=
1
;
//
iconNode.anchorX = 1;
iconNode
.
anchorY
=
1
;
//
iconNode.anchorY = 1;
iconNode
.
parent
=
cc
.
find
(
'
Canvas
'
);
//
iconNode.parent = cc.find('Canvas');
iconNode
.
x
=
iconNode
.
parent
.
width
/
2
-
10
;
//
iconNode.x = iconNode.parent.width / 2 - 10;
iconNode
.
y
=
iconNode
.
parent
.
height
/
2
-
10
;
//
iconNode.y = iconNode.parent.height / 2 - 10;
iconNode
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
()
=>
{
//
iconNode.on(cc.Node.EventType.TOUCH_START, () => {
this
.
playAudioByUrl
(
this
.
data
.
audio_url
);
//
this.playAudioByUrl(this.data.audio_url);
})
//
})
},
},
curPage
:
null
,
curPage
:
null
,
...
@@ -637,33 +848,33 @@ cc.Class({
...
@@ -637,33 +848,33 @@ cc.Class({
},
},
leftMove
()
{
leftMove
()
{
this
.
_cantouch
=
false
;
//
this._cantouch = false;
const
len
=
this
.
pic1
.
parent
.
width
;
//
const len = this.pic1.parent.width;
cc
.
tween
(
this
.
pic1
)
//
cc.tween(this.pic1)
.
to
(
1
,
{
x
:
this
.
pic1
.
baseX
},
{
easing
:
'
cubicInOut
'
})
//
.to(1, { x: this.pic1.baseX }, { easing: 'cubicInOut' })
.
start
();
//
.start();
cc
.
tween
(
this
.
pic2
)
//
cc.tween(this.pic2)
.
to
(
1
,
{
x
:
this
.
pic2
.
baseX
},
{
easing
:
'
cubicInOut
'
})
//
.to(1, { x: this.pic2.baseX }, { easing: 'cubicInOut' })
.
call
(()
=>
{
//
.call(() => {
this
.
_cantouch
=
true
;
//
this._cantouch = true;
})
//
})
.
start
();
//
.start();
},
},
rightMove
()
{
rightMove
()
{
this
.
_cantouch
=
false
;
//
this._cantouch = false;
const
len
=
this
.
pic1
.
parent
.
width
;
//
const len = this.pic1.parent.width;
cc
.
tween
(
this
.
pic1
)
//
cc.tween(this.pic1)
.
to
(
1
,
{
x
:
this
.
pic1
.
baseX
-
len
},
{
easing
:
'
cubicInOut
'
})
//
.to(1, { x: this.pic1.baseX - len }, { easing: 'cubicInOut' })
.
start
();
//
.start();
cc
.
tween
(
this
.
pic2
)
//
cc.tween(this.pic2)
.
to
(
1
,
{
x
:
this
.
pic2
.
baseX
-
len
},
{
easing
:
'
cubicInOut
'
})
//
.to(1, { x: this.pic2.baseX - len }, { easing: 'cubicInOut' })
.
call
(()
=>
{
//
.call(() => {
this
.
_cantouch
=
true
;
//
this._cantouch = true;
})
//
})
.
start
();
//
.start();
},
},
// update (dt) {},
// update (dt) {},
...
...
play/assets/OP15/textures/bg.png.meta
View file @
5de85225
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"premultiplyAlpha": false,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width":
256
0,
"width":
128
0,
"height":
192
0,
"height":
96
0,
"platformSettings": {},
"platformSettings": {},
"subMetas": {
"subMetas": {
"bg": {
"bg": {
...
...
play/assets/OP15/textures/m1.png.meta
View file @
5de85225
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"premultiplyAlpha": false,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width":
937
,
"width":
469
,
"height":
730
,
"height":
365
,
"platformSettings": {},
"platformSettings": {},
"subMetas": {
"subMetas": {
"m1": {
"m1": {
...
...
play/assets/OP15/textures/m2.png.meta
View file @
5de85225
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"premultiplyAlpha": false,
"genMipmaps": false,
"genMipmaps": false,
"packable": true,
"packable": true,
"width":
474
,
"width":
237
,
"height":
610
,
"height":
305
,
"platformSettings": {},
"platformSettings": {},
"subMetas": {
"subMetas": {
"m2": {
"m2": {
...
...
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