Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU21
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
PU21
Commits
83de2984
Commit
83de2984
authored
May 13, 2021
by
jeff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
d39ff12f
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
715 additions
and
285 deletions
+715
-285
angular.json
form/angular.json
+5
-2
custom-action.component.html
...src/app/common/custom-action/custom-action.component.html
+6
-5
custom-action.component.ts
form/src/app/common/custom-action/custom-action.component.ts
+3
-1
BRLNSDB.TTF
form/src/app/common/custom-hot-zone-mini/BRLNSDB.TTF
+0
-0
custom-hot-zone-mini.component.html
.../custom-hot-zone-mini/custom-hot-zone-mini.component.html
+2
-2
custom-hot-zone-mini.component.scss
.../custom-hot-zone-mini/custom-hot-zone-mini.component.scss
+4
-0
custom-hot-zone-mini.component.ts
...on/custom-hot-zone-mini/custom-hot-zone-mini.component.ts
+44
-46
form.component.html
form/src/app/form/form.component.html
+1
-1
form.component.ts
form/src/app/form/form.component.ts
+14
-9
hitItem.prefab
play/assets/scene/prefab/hitItem.prefab
+6
-33
picItem.prefab
play/assets/scene/prefab/picItem.prefab
+132
-0
picItem.prefab.meta
play/assets/scene/prefab/picItem.prefab.meta
+8
-0
wordsItem.prefab
play/assets/scene/prefab/wordsItem.prefab
+16
-46
hitItem.js
play/assets/scene/scene/hitItem.js
+19
-36
picItem.js
play/assets/scene/scene/picItem.js
+19
-0
picItem.js.meta
play/assets/scene/scene/picItem.js.meta
+9
-0
picNode.js
play/assets/scene/scene/picNode.js
+9
-3
scene.fire
play/assets/scene/scene/scene.fire
+383
-82
scene.js
play/assets/scene/scene/scene.js
+14
-4
wordsItem.js
play/assets/scene/scene/wordsItem.js
+20
-14
btn_laba.png.meta
play/assets/scene/textures/btn_laba.png.meta
+1
-1
No files found.
form/angular.json
View file @
83de2984
...
...
@@ -128,5 +128,8 @@
}
}
},
"defaultProject"
:
"ng-template-generator"
"defaultProject"
:
"ng-template-generator"
,
"cli"
:
{
"analytics"
:
"06333645-37f7-4fd6-9eb2-94a40b76c96a"
}
}
\ No newline at end of file
form/src/app/common/custom-action/custom-action.component.html
View file @
83de2984
...
...
@@ -91,13 +91,14 @@
</div>
</div>
<div
*
ngIf=
'audio'
>
<nz-divider
style=
"margin-top: 10px;"
></nz-divider>
<h4>
音频设置
</h4>
<app-audio-recorder
style=
"margin: auto"
[
audioUrl
]="
item
?.
audio_url
"
(
audioUploaded
)="
onItemAudioUploadSuccess
($
event
,
item
)"
></app-audio-recorder>
</div>
</div>
...
...
form/src/app/common/custom-action/custom-action.component.ts
View file @
83de2984
...
...
@@ -22,6 +22,8 @@ export class CustomActionComponent implements OnDestroy, OnChanges {
@
Input
()
type
=
'
text
'
@
Input
()
audio
=
true
@
Output
()
save
=
new
EventEmitter
();
...
...
form/src/app/common/custom-hot-zone-mini/BRLNSDB.TTF
0 → 100644
View file @
83de2984
File added
form/src/app/common/custom-hot-zone-mini/custom-hot-zone-mini.component.html
View file @
83de2984
...
...
@@ -19,7 +19,7 @@
<div>
<h5>
题干音频
</h5>
<div
style=
"display: flex;align-items: center; margin-top: 5px"
>
<app-audio-recorder
style=
"margin: auto"
[
audioUrl
]="
bgAudioUrl
"
<app-audio-recorder
style=
"margin: auto"
[
audioUrl
]="
bg
Item
?.
bg
AudioUrl
"
(
audioUploaded
)="
onBgAudioUploadSuucess
($
event
)"
></app-audio-recorder>
</div>
</div>
...
...
@@ -96,7 +96,7 @@
<div
*
ngIf=
"customTypeGroupArr[it.gIdx]?.action"
style=
"display: flex;align-items: center; margin-top: 5px"
>
<app-custom-action
style=
"margin: auto"
[
item
]="
it
?
it
['
actionData_
'
+
it
.
gIdx
]
:
{}"
[
type
]="
customTypeGroupArr
[
it
.
gIdx
].
action
.
type
"
[
option
]="
customTypeGroupArr
[
it
.
gIdx
].
action
.
option
"
(
save
)="
onSaveCustomAction
($
event
,
it
)"
>
(
save
)="
onSaveCustomAction
($
event
,
it
)"
[
audio
]
='
customTypeGroupArr
[
it
.
gIdx
].
action
.
audio
'
>
>
</app-custom-action>
</div>
...
...
form/src/app/common/custom-hot-zone-mini/custom-hot-zone-mini.component.scss
View file @
83de2984
@font-face
{
font-family
:
'font'
;
src
:
url('BRLNSDB.TTF')
;
}
.p-image-children-editor
{
width
:
100%
;
...
...
form/src/app/common/custom-hot-zone-mini/custom-hot-zone-mini.component.ts
View file @
83de2984
...
...
@@ -153,7 +153,7 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
this
.
initListener
();
this
.
init
();
//
this.init();
this
.
update
();
this
.
refresh
();
...
...
@@ -233,20 +233,6 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
}
addBtnClick
()
{
// this.imgArr.push({});
// this.hotZoneArr.push({});
const
item
=
this
.
getHotZoneItem
();
this
.
hotZoneArr
.
push
(
item
);
this
.
refreshItem
(
item
);
this
.
refreshHotZoneId
();
console
.
log
(
item
)
}
deleteBtnClick
(
index
)
{
const
item
=
this
.
hotZoneArr
.
splice
(
index
,
1
)[
0
];
...
...
@@ -364,7 +350,7 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
if
(
saveData
)
{
let
picUrl
=
saveData
.
pic_url
;
const
actionData
=
saveData
[
'
actionData_
'
+
item
.
gIdx
];
const
actionData
=
saveData
[
'
actionData_
'
];
if
(
actionData
&&
actionData
.
type
==
'
pic
'
)
{
picUrl
=
actionData
.
pic_url
;
}
...
...
@@ -428,7 +414,7 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
textLabel
.
text
=
saveData
.
text
}
this
.
setActionFont
(
textLabel
,
saveData
[
'
actionData_
'
+
item
.
gIdx
]);
this
.
setActionFont
(
textLabel
,
saveData
[
'
actionData_
'
]);
textLabel
.
refreshSize
();
}
...
...
@@ -515,37 +501,26 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
this
.
refresh
();
}
deleteItem
(
e
,
i
)
{
// this.imgArr.splice(i , 1);
// this.refreshImageId();
this
.
hotZoneArr
.
splice
(
i
,
1
);
this
.
refreshHotZoneId
();
this
.
refresh
();
}
addBtnClick
()
{
// this.imgArr.push({});
// this.hotZoneArr.push({});
const
item
=
this
.
getHotZoneItem
();
this
.
hotZoneArr
.
push
(
item
);
this
.
refreshCustomItem
(
item
)
// radioChange(e, item) {
// item.itemType = e;
this
.
refreshHotZoneId
();
// this.refreshItem(item);
// this.refresh();
// // console.log(' in radioChange e: ', e);
// }
}
customRadioChange
(
e
,
item
)
{
deleteItem
(
e
,
i
)
{
// this.imgArr.splice(i , 1);
// this.refreshImageId();
console
.
log
(
'
in customRadioChange
'
,
e
);
item
.
gIdx
=
-
1
;
setTimeout
(()
=>
{
item
.
gIdx
=
e
;
this
.
refreshCustomItem
(
item
);
this
.
hotZoneArr
.
splice
(
i
,
1
);
this
.
refreshHotZoneId
();
this
.
refresh
();
},
1
);
// const curGroup = this.customTypeGroupArr[e];
}
refreshCustomItem
(
item
)
{
...
...
@@ -585,6 +560,30 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
}
// radioChange(e, item) {
// item.itemType = e;
// this.refreshItem(item);
// this.refresh();
// // console.log(' in radioChange e: ', e);
// }
customRadioChange
(
e
,
item
)
{
console
.
log
(
'
in customRadioChange
'
,
e
);
item
.
gIdx
=
-
1
;
setTimeout
(()
=>
{
item
.
gIdx
=
e
;
this
.
refreshCustomItem
(
item
);
this
.
refresh
();
},
1
);
// const curGroup = this.customTypeGroupArr[e];
}
setItemIsAnimaStyle
(
item
,
isAnimal
)
{
}
...
...
@@ -598,7 +597,7 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
showItemLabel
(
item
)
{
item
.
textLabel
.
visible
=
true
;
item
.
itemType
=
'
text
'
;
this
.
showArrowTop
(
item
,
true
)
this
.
showArrowTop
(
item
)
}
showItemRect
(
item
,
isShowArrowTop
=
true
)
{
...
...
@@ -1140,7 +1139,7 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
useBorder
:
hotZoneArr
[
i
].
useBorder
};
hotZoneItem
[
'
actionData_
'
+
hotZoneItem
.
gIdx
]
=
hotZoneArr
[
i
][
'
actionData_
'
+
hotZoneArr
[
i
].
gIdx
]
hotZoneItem
[
'
actionData_
'
]
=
hotZoneArr
[
i
][
'
actionData_
'
]
if
(
this
.
hotZoneFontObj
)
{
...
...
@@ -1173,8 +1172,7 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
console
.
log
(
'
hotZoneItemArr:
'
,
hotZoneItemArr
);
// return { bgItem, hotZoneItemArr };
return
{
hotZoneItemArr
,
bgAudioUrl
:
this
.
bgAudioUrl
};
return
{
bgItem
,
hotZoneItemArr
};
}
saveText
(
item
)
{
...
...
@@ -1186,7 +1184,7 @@ export class CustomHotZoneComponent1 implements OnInit, OnDestroy, OnChanges {
onSaveCustomAction
(
e
,
item
)
{
const
data
=
e
;
item
[
'
actionData_
'
+
item
.
gIdx
]
=
data
;
item
[
'
actionData_
'
]
=
data
;
if
(
data
.
type
==
'
pic
'
)
{
let
picUrl
=
data
.
pic_url
;
...
...
form/src/app/form/form.component.html
View file @
83de2984
...
...
@@ -19,7 +19,7 @@
-->
<div
*
ngFor=
'let data of item ;index as i'
>
<span>
卡片{{i+1}}
</span>
<app-custom-hot-zone-mini
[
bg
AudioUrl
]="
data
.
bgAudioUrl
"
[
hotZoneItemArr
]="
data
.
hotZoneItemArr
"
<app-custom-hot-zone-mini
[
bg
Item
]="
data
.
bgItem
"
[
hotZoneItemArr
]="
data
.
hotZoneItemArr
"
[
customTypeGroupArr
]="
customTypeGroupArr
"
(
save
)="
saveHotZone
(
data
,
$
event
)"
(
del
)="
delHotZone
(
i
)"
>
</app-custom-hot-zone-mini>
</div>
...
...
form/src/app/form/form.component.ts
View file @
83de2984
...
...
@@ -19,23 +19,28 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
name
:
'
句子音频
'
,
action
:
{
type
:
'
text
'
,
audio
:
true
,
option
:
[
[
'
c
olor
'
,
'
#000000
'
],
[
'
s
ize
'
,
'
100
'
]
[
'
fontC
olor
'
,
'
#000000
'
],
[
'
fontS
ize
'
,
'
100
'
]
]
}
},
{
name
:
'
发音
区域
'
,
name
:
'
点击
区域
'
,
action
:
{
type
:
'
text
'
,
aduio
:
false
,
option
:
[
[
'
c
olor
'
,
'
#000000
'
],
[
'
s
ize
'
,
'
100
'
]
[
'
fontC
olor
'
,
'
#000000
'
],
[
'
fontS
ize
'
,
'
100
'
]
]
}
},
},
{
name
:
'
图片
'
,
pic
:
true
}
]
constructor
(
private
appRef
:
ApplicationRef
,
private
changeDetectorRef
:
ChangeDetectorRef
)
{
...
...
@@ -90,9 +95,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
/** 保存按钮 */
saveHotZone
(
group
,
e
)
{
console
.
log
(
'
e:
'
,
e
);
const
{
hotZoneItemArr
,
bgAudioUrl
}
=
e
;
const
{
hotZoneItemArr
,
bgItem
}
=
e
;
group
.
bg
AudioUrl
=
bgAudioUrl
;
group
.
bg
Item
=
bgItem
;
group
.
hotZoneItemArr
=
hotZoneItemArr
;
this
.
save
();
...
...
play/assets/scene/prefab/hitItem.prefab
View file @
83de2984
...
...
@@ -24,11 +24,11 @@
"_active": true,
"_components": [
{
"__id__":
6
"__id__":
5
}
],
"_prefab": {
"__id__":
7
"__id__":
6
},
"_opacity": 255,
"_color": {
...
...
@@ -89,13 +89,10 @@
"_components": [
{
"__id__": 3
},
{
"__id__": 4
}
],
"_prefab": {
"__id__":
5
"__id__":
4
},
"_opacity": 255,
"_color": {
...
...
@@ -179,33 +176,6 @@
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 18,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
...
...
@@ -228,6 +198,9 @@
"label": {
"__id__": 3
},
"tipClip": {
"__uuid__": "e0bcf4cc-35a7-4d61-b202-8dd49299c2c0"
},
"_id": ""
},
{
...
...
play/assets/scene/prefab/picItem.prefab
0 → 100644
View file @
83de2984
[
{
"__type__": "cc.Prefab",
"_name": "",
"_objFlags": 0,
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"asyncLoadAssets": false,
"readonly": false
},
{
"__type__": "cc.Node",
"_name": "node",
"_objFlags": 0,
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
},
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 36
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 1
},
"_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": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "8cdb44ac-a3f6-449f-b354-7cd48cf84061"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "577b3ZhuUNJtLzUNX3CEf1G",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "85e73971-9396-4c2a-9fac-2b187fd99c48"
},
"fileId": "",
"sync": false
}
]
\ No newline at end of file
play/assets/scene/prefab/picItem.prefab.meta
0 → 100644
View file @
83de2984
{
"ver": "1.2.9",
"uuid": "85e73971-9396-4c2a-9fac-2b187fd99c48",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
play/assets/scene/prefab/wordsItem.prefab
View file @
83de2984
...
...
@@ -21,17 +21,17 @@
"__id__": 2
},
{
"__id__":
6
"__id__":
5
}
],
"_active": true,
"_components": [
{
"__id__": 1
2
"__id__": 1
1
}
],
"_prefab": {
"__id__": 1
3
"__id__": 1
2
},
"_opacity": 255,
"_color": {
...
...
@@ -43,7 +43,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 64.
47
,
"width": 64.
51
,
"height": 55
},
"_anchorPoint": {
...
...
@@ -92,13 +92,10 @@
"_components": [
{
"__id__": 3
},
{
"__id__": 4
}
],
"_prefab": {
"__id__":
5
"__id__":
4
},
"_opacity": 255,
"_color": {
...
...
@@ -182,33 +179,6 @@
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 18,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
...
...
@@ -231,17 +201,17 @@
"_active": true,
"_components": [
{
"__id__":
7
"__id__":
6
},
{
"__id__":
8
"__id__":
7
},
{
"__id__":
9
"__id__":
8
}
],
"_prefab": {
"__id__": 1
1
"__id__": 1
0
},
"_opacity": 255,
"_color": {
...
...
@@ -265,8 +235,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
7
1.65
9,
-3.
917
,
7
8.80
9,
-3.
5
,
0,
0,
0,
...
...
@@ -295,7 +265,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
6
"__id__":
5
},
"_enabled": true,
"_materials": [
...
...
@@ -327,7 +297,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
6
"__id__":
5
},
"_enabled": true,
"_defaultClip": {
...
...
@@ -349,7 +319,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
6
"__id__":
5
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -358,7 +328,7 @@
"zoomScale": 1.1,
"clickEvents": [
{
"__id__":
10
"__id__":
9
}
],
"_N$interactable": true,
...
...
@@ -449,7 +419,7 @@
"__id__": 3
},
"playAnim": {
"__id__":
8
"__id__":
7
},
"_id": ""
},
...
...
play/assets/scene/scene/hitItem.js
View file @
83de2984
...
...
@@ -5,64 +5,47 @@ cc.Class({
extends
:
cc
.
Component
,
properties
:
{
label
:
cc
.
Label
label
:
cc
.
Label
,
tipClip
:
cc
.
AudioClip
},
data
:
null
,
onLoad
()
{
},
onEnable
()
{
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
)
cc
.
systemEvent
.
on
(
'
changeAnswerState
'
,
this
.
onChangeState
,
this
)
},
onDisable
()
{
this
.
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
,
this
.
onTouchStart
,
this
)
cc
.
systemEvent
.
off
(
'
changeAnswerState
'
,
this
.
onChangeState
,
this
)
},
initWithData
(
data
)
{
initWithData
(
data
,
scale
)
{
this
.
data
=
data
let
rect
=
this
.
data
.
rect
this
.
node
.
x
=
rect
.
x
+
rect
.
width
/
2
this
.
node
.
y
=
-
rect
.
y
-
rect
.
height
/
2
this
.
node
.
x
=
rect
.
x
*
scale
this
.
node
.
y
=
-
rect
.
y
*
scale
this
.
node
.
width
=
rect
.
width
this
.
node
.
height
=
rect
.
height
this
.
label
=
data
.
text
this
.
audioId
=
null
this
.
node
.
scale
=
data
.
fontScale
?
data
.
fontScale
*
scale
:
scale
let
action
=
data
[
'
actionData_
'
]
this
.
label
.
string
=
action
.
text
?
action
.
text
:
''
this
.
label
.
node
.
active
=
false
let
option
=
action
.
changeOption
this
.
label
.
node
.
color
=
option
[
0
][
1
]
?
cc
.
color
(
option
[
0
][
1
])
:
cc
.
color
(
0
,
0
,
0
)
},
onTouchStart
()
{
if
(
this
.
audioId
)
return
if
(
this
.
data
)
{
let
url
=
this
.
data
.
audio_url
if
(
url
&&
url
!=
''
)
{
this
.
playAudio
(
url
)
this
.
tipsAnim
.
node
.
active
=
true
this
.
tipsAnim
.
play
()
}
this
.
label
.
node
.
active
=
true
cc
.
audioEngine
.
play
(
this
.
tipClip
)
}
},
/** 播放音乐 */
playAudio
(
url
)
{
cc
.
assetManager
.
loadRemote
(
url
,
(
err
,
audioClip
)
=>
{
if
(
err
)
return
cc
.
systemEvent
.
once
(
'
stopMusic
'
,
this
.
stopAudio
,
this
)
this
.
audioId
=
cc
.
audioEngine
.
play
(
audioClip
,
false
,
0.8
);
cc
.
audioEngine
.
setFinishCallback
(
this
.
audioId
,
this
.
stopAudio
.
bind
(
this
));
});
},
stopAudio
()
{
if
(
this
.
audioId
!=
null
)
{
cc
.
audioEngine
.
stop
(
this
.
audioId
)
this
.
audioId
=
null
cc
.
systemEvent
.
off
(
'
stopMusic
'
,
this
.
stopAudio
,
this
)
/** 改变答案显示状态 */
onChangeState
(
show
)
{
this
.
label
.
node
.
active
=
show
}
},
/** 音频id */
audioId
:
null
,
});
play/assets/scene/scene/picItem.js
0 → 100644
View file @
83de2984
const
tools
=
require
(
"
../script/tools
"
);
cc
.
Class
({
extends
:
cc
.
Component
,
properties
:
{
},
initWithData
(
data
,
scale
)
{
let
sprite
=
this
.
getComponent
(
cc
.
Sprite
)
tools
.
getSpriteFrimeByUrl
(
data
.
pic_url
,(
sp
)
=>
{
sprite
.
spriteFrame
=
sp
let
rect
=
data
.
rect
this
.
node
.
setPosition
(
rect
.
x
*
scale
,
-
rect
.
y
*
scale
)
this
.
node
.
width
=
rect
.
width
*
scale
this
.
node
.
height
=
rect
.
height
*
scale
})
}
});
play/assets/scene/scene/picItem.js.meta
0 → 100644
View file @
83de2984
{
"ver": "1.0.8",
"uuid": "577b3661-b943-49b4-bcd4-357dc211fd46",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
play/assets/scene/scene/picNode.js
View file @
83de2984
...
...
@@ -5,7 +5,8 @@ cc.Class({
properties
:
{
hitPre
:
cc
.
Prefab
,
wordsPre
:
cc
.
Prefab
wordsPre
:
cc
.
Prefab
,
picPre
:
cc
.
Prefab
},
onLoad
()
{
...
...
@@ -54,17 +55,22 @@ cc.Class({
// this._hitItem.push(node)
// }
// })
let
rect
=
data
.
bgItem
.
rect
let
scale
=
1280
/
rect
.
width
let
node
for
(
let
one
of
data
.
hotZoneItemArr
)
{
if
(
one
.
gIdx
==
'
0
'
)
{
// 发音句子
node
=
cc
.
instantiate
(
this
.
wordsPre
)
comp
=
node
.
getComponent
(
'
wordsItem
'
)
}
else
{
}
else
if
(
one
.
gIdx
==
'
1
'
)
{
node
=
cc
.
instantiate
(
this
.
hitPre
)
comp
=
node
.
getComponent
(
'
hitItem
'
)
}
else
{
node
=
cc
.
instantiate
(
this
.
picPre
)
comp
=
node
.
getComponent
(
'
picItem
'
)
}
this
.
_items
.
addChild
(
node
)
comp
.
initWithData
(
one
)
comp
.
initWithData
(
one
,
scale
)
this
.
_hitItem
.
push
(
node
)
}
},
...
...
play/assets/scene/scene/scene.fire
View file @
83de2984
...
...
@@ -78,25 +78,25 @@
"__id__": 8
},
{
"__id__": 1
4
"__id__": 1
5
},
{
"__id__":
19
"__id__":
21
},
{
"__id__": 3
3
"__id__": 3
9
}
],
"_active": true,
"_components": [
{
"__id__":
48
"__id__":
54
},
{
"__id__":
49
"__id__":
55
},
{
"__id__": 5
0
"__id__": 5
6
}
],
"_prefab": null,
...
...
@@ -387,7 +387,7 @@
"_active": true,
"_components": [
{
"__id__": 1
3
"__id__": 1
4
}
],
"_prefab": null,
...
...
@@ -569,7 +569,11 @@
},
"_children": [],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 13
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
...
...
@@ -581,7 +585,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width":
72
0,
"width":
128
0,
"height": 720
},
"_anchorPoint": {
...
...
@@ -593,7 +597,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-
36
0,
-
64
0,
360,
0,
0,
...
...
@@ -618,6 +622,33 @@
"groupIndex": 0,
"_id": "3a4oi+4+9Ka6PX0pprclAn"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 720,
"_originalHeight": 720,
"_id": "b7NRXHDjZD05w1ysTiZHhR"
},
{
"__type__": "fccd421MOxLZq6iwp/QwDAf",
"_name": "",
...
...
@@ -632,6 +663,9 @@
"wordsPre": {
"__uuid__": "a33b90a4-90af-4a31-91ad-110894bbe407"
},
"picPre": {
"__uuid__": "85e73971-9396-4c2a-9fac-2b187fd99c48"
},
"_id": "25htXxEOZC+47ROkvoLV/U"
},
{
...
...
@@ -643,16 +677,16 @@
},
"_children": [
{
"__id__": 1
5
"__id__": 1
6
},
{
"__id__": 1
7
"__id__": 1
8
}
],
"_active": true,
"_components": [
{
"__id__":
18
"__id__":
20
}
],
"_prefab": null,
...
...
@@ -708,13 +742,13 @@
"_name": "icon",
"_objFlags": 0,
"_parent": {
"__id__": 1
4
"__id__": 1
5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
6
"__id__": 1
7
}
],
"_prefab": null,
...
...
@@ -770,7 +804,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
5
"__id__": 1
6
},
"_enabled": true,
"_materials": [
...
...
@@ -800,11 +834,15 @@
"_name": "items",
"_objFlags": 0,
"_parent": {
"__id__": 1
4
"__id__": 1
5
},
"_children": [],
"_active": true,
"_components": [],
"_components": [
{
"__id__": 19
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
...
...
@@ -816,20 +854,20 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width":
128
0,
"height":
72
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0
.5
,
"y":
0.5
"x": 0,
"y":
1
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
1274
,
0,
-640
,
36
0,
0,
0,
0,
...
...
@@ -853,12 +891,39 @@
"groupIndex": 0,
"_id": "60JG0g75NIdb8hWvDUsLMj"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "4eE1g6Ls9Nf5cKwDfBu7o1"
},
{
"__type__": "fccd421MOxLZq6iwp/QwDAf",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
4
"__id__": 1
5
},
"_enabled": true,
"hitPre": {
...
...
@@ -867,6 +932,9 @@
"wordsPre": {
"__uuid__": "a33b90a4-90af-4a31-91ad-110894bbe407"
},
"picPre": {
"__uuid__": "85e73971-9396-4c2a-9fac-2b187fd99c48"
},
"_id": "89aCQ7yHtOn4s8onn5MbAu"
},
{
...
...
@@ -877,9 +945,6 @@
"__id__": 2
},
"_children": [
{
"__id__": 20
},
{
"__id__": 22
},
...
...
@@ -887,13 +952,16 @@
"__id__": 24
},
{
"__id__": 28
"__id__": 30
},
{
"__id__": 34
}
],
"_active": true,
"_components": [
{
"__id__": 3
2
"__id__": 3
8
}
],
"_prefab": null,
...
...
@@ -949,13 +1017,13 @@
"_name": "bg_bottom",
"_objFlags": 0,
"_parent": {
"__id__":
19
"__id__":
21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
1
"__id__": 2
3
}
],
"_prefab": null,
...
...
@@ -1011,7 +1079,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
0
"__id__": 2
2
},
"_enabled": true,
"_materials": [
...
...
@@ -1043,13 +1111,81 @@
"_name": "btn_checkall",
"_objFlags": 0,
"_parent": {
"__id__": 19
"__id__": 21
},
"_children": [
{
"__id__": 25
},
{
"__id__": 28
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 64,
"height": 68
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-66,
-3,
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": "d0K0yjGA1FTbMcepb4WHvy"
},
{
"__type__": "cc.Node",
"_name": "show",
"_objFlags": 0,
"_parent": {
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
"__id__": 26
},
{
"__id__": 27
}
],
"_prefab": null,
...
...
@@ -1075,8 +1211,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-75
,
-2
,
0
,
0
,
0,
0,
0,
...
...
@@ -1105,7 +1241,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
2
"__id__": 2
5
},
"_enabled": true,
"_materials": [
...
...
@@ -1132,21 +1268,183 @@
"_atlas": null,
"_id": "200LqappFKCLUsTniwvise"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "62ZpyFmY1Hc7xJHrjZMag1"
},
{
"__type__": "cc.Node",
"_name": "btn_replay",
"_objFlags": 0,
"_parent": {
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 29
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 64,
"height": 69
},
"_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": "246gastDRKu7/xuNtl/imt"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "9266d645-d228-407a-8bf1-5bff25c516c3"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "f6oF0y1r1EELhPtNQWrpv2"
},
{
"__type__": "cc.Node",
"_name": "btn_left",
"_objFlags": 0,
"_parent": {
"__id__":
19
"__id__":
21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
25
"__id__":
31
},
{
"__id__":
27
"__id__":
33
}
],
"_prefab": null,
...
...
@@ -1202,7 +1500,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
24
"__id__":
30
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -1211,7 +1509,7 @@
"zoomScale": 1.1,
"clickEvents": [
{
"__id__":
26
"__id__":
32
}
],
"_N$interactable": true,
...
...
@@ -1284,7 +1582,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
24
"__id__":
30
},
"_enabled": true,
"_materials": [
...
...
@@ -1316,16 +1614,16 @@
"_name": "btn_right",
"_objFlags": 0,
"_parent": {
"__id__":
19
"__id__":
21
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
29
"__id__":
35
},
{
"__id__": 3
1
"__id__": 3
7
}
],
"_prefab": null,
...
...
@@ -1381,7 +1679,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
28
"__id__":
34
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -1390,7 +1688,7 @@
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 3
0
"__id__": 3
6
}
],
"_N$interactable": true,
...
...
@@ -1463,7 +1761,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
28
"__id__":
34
},
"_enabled": true,
"_materials": [
...
...
@@ -1495,7 +1793,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
19
"__id__":
21
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -1526,19 +1824,19 @@
},
"_children": [
{
"__id__":
34
"__id__":
40
},
{
"__id__":
39
"__id__":
45
},
{
"__id__":
45
"__id__":
51
}
],
"_active": true,
"_components": [
{
"__id__":
47
"__id__":
53
}
],
"_prefab": null,
...
...
@@ -1594,14 +1892,14 @@
"_name": "btnPlay",
"_objFlags": 0,
"_parent": {
"__id__": 3
3
"__id__": 3
9
},
"_children": [
{
"__id__":
35
"__id__":
41
},
{
"__id__":
37
"__id__":
43
}
],
"_active": true,
...
...
@@ -1659,13 +1957,13 @@
"_name": "btn_stop",
"_objFlags": 0,
"_parent": {
"__id__":
34
"__id__":
40
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
36
"__id__":
42
}
],
"_prefab": null,
...
...
@@ -1721,7 +2019,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
35
"__id__":
41
},
"_enabled": true,
"_materials": [
...
...
@@ -1753,13 +2051,13 @@
"_name": "btn_next",
"_objFlags": 0,
"_parent": {
"__id__":
34
"__id__":
40
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
38
"__id__":
44
}
],
"_prefab": null,
...
...
@@ -1815,7 +2113,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
37
"__id__":
43
},
"_enabled": true,
"_materials": [
...
...
@@ -1847,20 +2145,20 @@
"_name": "bg_tiaodi",
"_objFlags": 0,
"_parent": {
"__id__": 3
3
"__id__": 3
9
},
"_children": [
{
"__id__": 4
0
"__id__": 4
6
},
{
"__id__": 4
2
"__id__": 4
8
}
],
"_active": true,
"_components": [
{
"__id__":
44
"__id__":
50
}
],
"_prefab": null,
...
...
@@ -1916,13 +2214,13 @@
"_name": "bg_tiao",
"_objFlags": 0,
"_parent": {
"__id__":
39
"__id__":
45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
1
"__id__": 4
7
}
],
"_prefab": null,
...
...
@@ -1978,7 +2276,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
0
"__id__": 4
6
},
"_enabled": true,
"_materials": [
...
...
@@ -2010,13 +2308,13 @@
"_name": "icon_move",
"_objFlags": 0,
"_parent": {
"__id__":
39
"__id__":
45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
3
"__id__": 4
9
}
],
"_prefab": null,
...
...
@@ -2072,7 +2370,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
2
"__id__": 4
8
},
"_enabled": true,
"_materials": [
...
...
@@ -2104,7 +2402,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
39
"__id__":
45
},
"_enabled": true,
"_materials": [
...
...
@@ -2136,13 +2434,13 @@
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 3
3
"__id__": 3
9
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
46
"__id__":
52
}
],
"_prefab": null,
...
...
@@ -2198,7 +2496,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
45
"__id__":
51
},
"_enabled": true,
"_materials": [
...
...
@@ -2231,7 +2529,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
3
"__id__": 3
9
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2309,13 +2607,16 @@
"__id__": 8
},
"picTempNode": {
"__id__": 1
4
"__id__": 1
5
},
"leftNode": {
"__id__":
24
"__id__":
30
},
"rightNode": {
"__id__": 28
"__id__": 34
},
"bgAudioNode": {
"__id__": 39
},
"btnClip": {
"__uuid__": "39ef1939-3bf9-4d21-a67a-bc1dede521a9"
...
...
play/assets/scene/scene/scene.js
View file @
83de2984
...
...
@@ -20,6 +20,7 @@ cc.Class({
type
:
cc
.
Node
,
default
:
null
},
bgAudioNode
:
cc
.
Node
,
btnClip
:
cc
.
AudioClip
},
...
...
@@ -87,11 +88,11 @@ cc.Class({
},
onEnable
()
{
cc
.
systemEvent
.
on
(
'
playAudio
'
,
this
.
onPlayAudio
,
this
)
},
onDisable
()
{
cc
.
systemEvent
.
off
(
'
playAudio
'
,
this
.
onPlayAudio
,
this
)
},
...
...
@@ -100,7 +101,7 @@ cc.Class({
},
getDefaultData
()
{
const
dataJson
=
'
[{"hotZoneItemArr":[{"id":"1620866294132","index":0,"itemType":"text","fontScale":0.29296875,"imgScale":1,"mapScale":0.29296875,"gIdx":"0","rect":{"width":58.1,"height":11.72,"x":300.54,"y":305.15}},{"id":"1620866973543","index":1,"itemType":"text","fontScale":0.29296875,"imgScale":1,"mapScale":0.29296875,"gIdx":"1","rect":{"width":46.84,"height":11.72,"x":387.59,"y":236.14}}],"bgAudioUrl":"http://staging-teach.cdn.ireadabc.com/c8a7dd49a778b0b6dd509aac0ef437ff.mp3"
}]
'
const
dataJson
=
'
[{"hotZoneItemArr":[{"id":"1620886548676","index":0,"pic_url":"http://staging-teach.cdn.ireadabc.com/aa0d852ef05d9d8de158f10b4a727376.jpg","itemType":"text","fontScale":0.7859375,"imgScale":0.5236111111111111,"mapScale":0.7859375,"gIdx":"0","actionData_":{"type":"text","changeOption":[["fontColor","#000000"],["fontSize","100"]],"text":"I WANT Fly","audio_url":"http://staging-teach.cdn.ireadabc.com/bd0502e664d0d279ccbec4e22b60f051.mp3"},"rect":{"width":438.31,"height":78.59,"x":115.96,"y":149.2}}],"bgItem":{"url":"http://staging-teach.cdn.ireadabc.com/b90a006ba41723ec11970051e92f43e0.png","rect":{"x":167.89,"y":0,"width":670.22,"height":377}}
}]
'
const
data
=
JSON
.
parse
(
dataJson
);
return
data
;
},
...
...
@@ -270,8 +271,17 @@ cc.Class({
console
.
log
(
'
数据错误
'
)
return
}
picNode
.
getComponent
(
'
picNode
'
).
initWithData
(
data
)
if
(
data
.
bgAudioUrl
&&
data
.
bgAudioUrl
!=
''
)
{
this
.
bgAudioNode
.
active
=
true
}
else
{
this
.
bgAudioNode
.
active
=
false
}
picNode
.
getComponent
(
'
picNode
'
).
initWithData
(
data
)
},
/** 点击切换答案显示 */
onCheckall
()
{
}
// ------------------------------------------
});
play/assets/scene/scene/wordsItem.js
View file @
83de2984
...
...
@@ -10,6 +10,8 @@ cc.Class({
data
:
null
,
audio_url
:
null
,
onEnable
()
{
},
...
...
@@ -17,18 +19,25 @@ cc.Class({
},
initWithData
(
data
)
{
initWithData
(
data
,
scale
)
{
this
.
data
=
data
let
rect
=
this
.
data
.
rect
console
.
log
(
rect
)
this
.
node
.
x
=
rect
.
x
+
rect
.
width
/
2
this
.
node
.
y
=
-
rect
.
y
-
rect
.
height
/
2
this
.
node
.
width
=
rect
.
width
this
.
node
.
height
=
rect
.
height
this
.
node
.
scale
=
data
.
fontScale
?
data
.
fontScale
:
1
this
.
label
.
string
=
data
.
text
?
data
.
text
:
''
this
.
node
.
x
=
(
rect
.
x
+
rect
.
width
/
2
)
*
scale
this
.
node
.
y
=
(
-
rect
.
y
-
rect
.
height
/
2
)
*
scale
let
action
=
data
[
'
actionData_
'
]
let
node
=
this
.
label
.
node
let
option
=
action
.
changeOption
node
.
color
=
option
[
0
][
1
]
?
cc
.
color
(
option
[
0
][
1
])
:
cc
.
color
(
0
,
0
,
0
)
node
.
scale
=
data
.
fontScale
?
data
.
fontScale
*
scale
:
scale
this
.
label
.
string
=
action
.
text
?
action
.
text
:
''
this
.
node
.
width
=
node
.
width
*
node
.
scale
this
.
node
.
height
=
node
.
height
*
node
.
height
this
.
audioId
=
null
if
(
data
.
audio_url
)
{
this
.
audio_url
=
action
.
audio_url
if
(
this
.
audio_url
)
{
let
node
=
this
.
playAnim
.
node
node
.
scale
=
1
/
this
.
node
.
scale
node
.
setPosition
(
this
.
label
.
node
.
width
+
node
.
width
/
2
+
15
,
-
this
.
node
.
height
/
2
)
this
.
playAnim
.
node
.
active
=
true
}
else
{
this
.
playAnim
.
node
.
active
=
false
...
...
@@ -37,11 +46,8 @@ cc.Class({
onTouchStart
()
{
if
(
this
.
audioId
)
return
if
(
this
.
data
)
{
let
url
=
this
.
data
.
audio_url
if
(
url
&&
url
!=
''
)
{
this
.
playAudio
(
url
)
}
if
(
this
.
audio_url
&&
this
.
audio_url
!=
''
)
{
this
.
playAudio
(
this
.
audio_url
)
this
.
playAnim
.
play
(
'
play
'
)
}
},
...
...
play/assets/scene/textures/btn_laba.png.meta
View file @
83de2984
...
...
@@ -27,7 +27,7 @@
"rawWidth": 55,
"rawHeight": 59,
"borderTop": 0,
"borderBottom":
0
,
"borderBottom":
2
,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
...
...
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