Commit 8a1086d4 authored by liujiaxin's avatar liujiaxin

feat: form add pic

parent d24c10f5
......@@ -15,8 +15,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
item;
customTypeGroupArr = [
{
name: '动画',
name: '交互动画',
anima: true,
audio: true,
// pic: true,
......@@ -27,6 +28,29 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
label: '开始提示时间点',
},
{
name: '显示动画',
anima: true,
// audio: true,
// pic: true,
// rect: true,
// text: true,
// isShowPos: true,
// isCopy: true,
// label: '开始提示时间点',
},
{
name: '图片',
// anima: true,
// audio: true,
pic: true,
rect: true,
// text: true,
// isShowPos: true,
// isCopy: true,
// label: '开始提示时间点',
},
];
saveHotZone(group, e) {
console.log('e: ', e);
......
// Learn cc.Class:
// - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// // ATTRIBUTES:
// default: null, // The default value will be used only when the component attaching
// // to a node for the first time
// type: cc.SpriteFrame, // optional, default is typeof default
// serializable: true, // optional, default is true
// },
// bar: {
// get () {
// return this._bar;
// },
// set (value) {
// this._bar = value;
// }
// },
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
start () {
},
// update (dt) {},
});
{
"ver": "1.0.8",
"uuid": "b56c4835-4cb7-41b4-8c9c-ac00380d1ba3",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
......@@ -917,7 +917,7 @@
},
{
"__type__": "cc.Node",
"_name": "house",
"_name": "cow",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -940,8 +940,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1143,
"height": 951
"width": 490,
"height": 373
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -952,16 +952,16 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
145.326,
133.912,
0,
0,
0,
0,
0,
0,
1,
0.22,
0.22,
0.25
0.25,
0.25,
1
]
},
"_eulerAngles": {
......@@ -975,7 +975,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "2fvyP6xbtEn7x9BYufNC9G"
"_id": "32TEJDnbhMN7KT3gByoG4t"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -996,7 +996,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "7bb49576-efa4-4634-ae72-9a1691dea9f6#935da5b5-62fd-4317-b654-771501096d80",
"_armatureKey": "ff8e808c-0f2c-437d-93a2-e427b8036108#e49a7f11-180e-464a-b737-4100c50c5293",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -1004,10 +1004,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "7bb49576-efa4-4634-ae72-9a1691dea9f6"
"__uuid__": "ff8e808c-0f2c-437d-93a2-e427b8036108"
},
"_N$dragonAtlasAsset": {
"__uuid__": "935da5b5-62fd-4317-b654-771501096d80"
"__uuid__": "e49a7f11-180e-464a-b737-4100c50c5293"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -1015,11 +1015,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "dfoxaP1BZCaJkl0P1Av6jU"
"_id": "13p+CDbYxKh6Neq43ZxC7X"
},
{
"__type__": "cc.Node",
"_name": "cow",
"_name": "apple",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -1042,8 +1042,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 490,
"height": 373
"width": 799,
"height": 565
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1077,7 +1077,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "32TEJDnbhMN7KT3gByoG4t"
"_id": "a4xySIvblKnYP3MSugLg2o"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -1098,7 +1098,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "ff8e808c-0f2c-437d-93a2-e427b8036108#e49a7f11-180e-464a-b737-4100c50c5293",
"_armatureKey": "4d85228f-ec02-4cbe-a0d8-cc8628fe805d#146d0d76-3625-438b-a6c8-dbd27ca2af63",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -1106,10 +1106,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "ff8e808c-0f2c-437d-93a2-e427b8036108"
"__uuid__": "4d85228f-ec02-4cbe-a0d8-cc8628fe805d"
},
"_N$dragonAtlasAsset": {
"__uuid__": "e49a7f11-180e-464a-b737-4100c50c5293"
"__uuid__": "146d0d76-3625-438b-a6c8-dbd27ca2af63"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -1117,11 +1117,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "13p+CDbYxKh6Neq43ZxC7X"
"_id": "552Xm8CDxMpIOVobC+Q//U"
},
{
"__type__": "cc.Node",
"_name": "apple",
"_name": "bird",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -1144,8 +1144,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 799,
"height": 565
"width": 214,
"height": 171
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1179,7 +1179,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a4xySIvblKnYP3MSugLg2o"
"_id": "9aJcXS8bdKj47wtsfNhmXs"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -1200,7 +1200,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "4d85228f-ec02-4cbe-a0d8-cc8628fe805d#146d0d76-3625-438b-a6c8-dbd27ca2af63",
"_armatureKey": "c09e0f09-3dcd-48ab-96e9-b3411b332e30#f7c2a4ed-1ea1-47fa-af1a-b0a87503411a",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -1208,10 +1208,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "4d85228f-ec02-4cbe-a0d8-cc8628fe805d"
"__uuid__": "c09e0f09-3dcd-48ab-96e9-b3411b332e30"
},
"_N$dragonAtlasAsset": {
"__uuid__": "146d0d76-3625-438b-a6c8-dbd27ca2af63"
"__uuid__": "f7c2a4ed-1ea1-47fa-af1a-b0a87503411a"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -1219,11 +1219,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "552Xm8CDxMpIOVobC+Q//U"
"_id": "04F4O9iptO77MTN5BpBjLp"
},
{
"__type__": "cc.Node",
"_name": "bird",
"_name": "car",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -1246,8 +1246,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 214,
"height": 171
"width": 314,
"height": 175
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1281,7 +1281,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "9aJcXS8bdKj47wtsfNhmXs"
"_id": "58za+HBcxMWJ6BCVXzaDJ9"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -1302,7 +1302,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "c09e0f09-3dcd-48ab-96e9-b3411b332e30#f7c2a4ed-1ea1-47fa-af1a-b0a87503411a",
"_armatureKey": "927c2190-9931-4948-bc8f-f93273d386f1#cb558b4f-c46d-4597-be52-2a01e9919a07",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -1310,10 +1310,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "c09e0f09-3dcd-48ab-96e9-b3411b332e30"
"__uuid__": "927c2190-9931-4948-bc8f-f93273d386f1"
},
"_N$dragonAtlasAsset": {
"__uuid__": "f7c2a4ed-1ea1-47fa-af1a-b0a87503411a"
"__uuid__": "cb558b4f-c46d-4597-be52-2a01e9919a07"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -1321,11 +1321,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "04F4O9iptO77MTN5BpBjLp"
"_id": "25dK2Sp95JZLKy6DBkvVC2"
},
{
"__type__": "cc.Node",
"_name": "car",
"_name": "cat",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -1348,8 +1348,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 314,
"height": 175
"width": 451,
"height": 489
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1383,7 +1383,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "58za+HBcxMWJ6BCVXzaDJ9"
"_id": "65ayr7TKxHAag/Ti4Xmp+i"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -1404,7 +1404,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "927c2190-9931-4948-bc8f-f93273d386f1#cb558b4f-c46d-4597-be52-2a01e9919a07",
"_armatureKey": "0d98c5c3-f6ce-4b53-8b13-3f64793c6c2a#6f320da8-7ad6-4576-9ed9-9f008f467cf7",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -1412,10 +1412,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "927c2190-9931-4948-bc8f-f93273d386f1"
"__uuid__": "0d98c5c3-f6ce-4b53-8b13-3f64793c6c2a"
},
"_N$dragonAtlasAsset": {
"__uuid__": "cb558b4f-c46d-4597-be52-2a01e9919a07"
"__uuid__": "6f320da8-7ad6-4576-9ed9-9f008f467cf7"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -1423,11 +1423,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "25dK2Sp95JZLKy6DBkvVC2"
"_id": "24iVKgQhhEqoFPGYtXW6yO"
},
{
"__type__": "cc.Node",
"_name": "cat",
"_name": "duck",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -1450,8 +1450,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 451,
"height": 489
"width": 314,
"height": 297
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1485,7 +1485,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "65ayr7TKxHAag/Ti4Xmp+i"
"_id": "61ff7eZCtHBq7NNSCiAD7D"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -1506,7 +1506,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "0d98c5c3-f6ce-4b53-8b13-3f64793c6c2a#6f320da8-7ad6-4576-9ed9-9f008f467cf7",
"_armatureKey": "f697428d-39cf-4b2d-8d49-85c508b96d9b#89adc0d0-7e7a-444f-bd48-548ccd5fe537",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -1514,10 +1514,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "0d98c5c3-f6ce-4b53-8b13-3f64793c6c2a"
"__uuid__": "f697428d-39cf-4b2d-8d49-85c508b96d9b"
},
"_N$dragonAtlasAsset": {
"__uuid__": "6f320da8-7ad6-4576-9ed9-9f008f467cf7"
"__uuid__": "89adc0d0-7e7a-444f-bd48-548ccd5fe537"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -1525,11 +1525,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "24iVKgQhhEqoFPGYtXW6yO"
"_id": "84sPYtWQ9IDLcwvzpJqV/z"
},
{
"__type__": "cc.Node",
"_name": "duck",
"_name": "egg",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -1552,8 +1552,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 314,
"height": 297
"width": 277,
"height": 286
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1587,7 +1587,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "61ff7eZCtHBq7NNSCiAD7D"
"_id": "85+u6pJ7JE/YyU8B1cvu3e"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -1608,7 +1608,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "f697428d-39cf-4b2d-8d49-85c508b96d9b#89adc0d0-7e7a-444f-bd48-548ccd5fe537",
"_armatureKey": "07fab63b-dbeb-4664-9fc2-fcdc4a306891#240bda05-66e5-47db-ae31-f5f30ca6cfd5",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -1616,10 +1616,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "f697428d-39cf-4b2d-8d49-85c508b96d9b"
"__uuid__": "07fab63b-dbeb-4664-9fc2-fcdc4a306891"
},
"_N$dragonAtlasAsset": {
"__uuid__": "89adc0d0-7e7a-444f-bd48-548ccd5fe537"
"__uuid__": "240bda05-66e5-47db-ae31-f5f30ca6cfd5"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -1627,11 +1627,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "84sPYtWQ9IDLcwvzpJqV/z"
"_id": "72OZTXG9RLKpBh2Gv64YXG"
},
{
"__type__": "cc.Node",
"_name": "egg",
"_name": "farmer",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -1654,8 +1654,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 277,
"height": 286
"width": 834,
"height": 1049
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1689,7 +1689,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "85+u6pJ7JE/YyU8B1cvu3e"
"_id": "d7If138KBF75ojV5qkoCmq"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -1710,7 +1710,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "07fab63b-dbeb-4664-9fc2-fcdc4a306891#240bda05-66e5-47db-ae31-f5f30ca6cfd5",
"_armatureKey": "db9ac426-bc0d-430c-97b8-750df4db43c8#e9153428-8986-46f2-9d26-2e6f1c4aeb1e",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -1718,10 +1718,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "07fab63b-dbeb-4664-9fc2-fcdc4a306891"
"__uuid__": "db9ac426-bc0d-430c-97b8-750df4db43c8"
},
"_N$dragonAtlasAsset": {
"__uuid__": "240bda05-66e5-47db-ae31-f5f30ca6cfd5"
"__uuid__": "e9153428-8986-46f2-9d26-2e6f1c4aeb1e"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -1729,11 +1729,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "72OZTXG9RLKpBh2Gv64YXG"
"_id": "0bDiHchFNFaaCO/dbsl68O"
},
{
"__type__": "cc.Node",
"_name": "farmer",
"_name": "fish",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -1756,8 +1756,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 834,
"height": 1049
"width": 217,
"height": 205
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1791,7 +1791,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "d7If138KBF75ojV5qkoCmq"
"_id": "b6qtDg3hBEC5ul7rxqjANE"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -1812,7 +1812,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "db9ac426-bc0d-430c-97b8-750df4db43c8#e9153428-8986-46f2-9d26-2e6f1c4aeb1e",
"_armatureKey": "836b38d9-903e-46a7-98a4-a92a73692141#bb32454f-d5d1-41d8-b261-026462149641",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -1820,10 +1820,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "db9ac426-bc0d-430c-97b8-750df4db43c8"
"__uuid__": "836b38d9-903e-46a7-98a4-a92a73692141"
},
"_N$dragonAtlasAsset": {
"__uuid__": "e9153428-8986-46f2-9d26-2e6f1c4aeb1e"
"__uuid__": "bb32454f-d5d1-41d8-b261-026462149641"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -1831,11 +1831,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "0bDiHchFNFaaCO/dbsl68O"
"_id": "8fFExVrZ5DqaBKYIo7TuCN"
},
{
"__type__": "cc.Node",
"_name": "fish",
"_name": "girl",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -1858,8 +1858,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 217,
"height": 205
"width": 544,
"height": 835
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1893,7 +1893,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b6qtDg3hBEC5ul7rxqjANE"
"_id": "1dxGPLnSpNhLQ1+Sa2Vlxf"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -1914,7 +1914,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "836b38d9-903e-46a7-98a4-a92a73692141#bb32454f-d5d1-41d8-b261-026462149641",
"_armatureKey": "5944f89e-5b70-4b17-af99-09fa63c15f23#2368f043-d708-4d13-886b-6e7d83f98c30",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -1922,10 +1922,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "836b38d9-903e-46a7-98a4-a92a73692141"
"__uuid__": "5944f89e-5b70-4b17-af99-09fa63c15f23"
},
"_N$dragonAtlasAsset": {
"__uuid__": "bb32454f-d5d1-41d8-b261-026462149641"
"__uuid__": "2368f043-d708-4d13-886b-6e7d83f98c30"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -1933,11 +1933,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "8fFExVrZ5DqaBKYIo7TuCN"
"_id": "acO6TMfKtIv65PTdTqRBUo"
},
{
"__type__": "cc.Node",
"_name": "girl",
"_name": "hen",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -1960,8 +1960,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 544,
"height": 835
"width": 1007.37,
"height": 596.06
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1995,7 +1995,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "1dxGPLnSpNhLQ1+Sa2Vlxf"
"_id": "5cQofg3whIsqMKpbpzXhuY"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -2016,7 +2016,7 @@
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "5944f89e-5b70-4b17-af99-09fa63c15f23#2368f043-d708-4d13-886b-6e7d83f98c30",
"_armatureKey": "9f8f3a2e-e2dd-4d29-92ac-6fb9d1279bca#bf5fa08c-7de5-4bf0-857b-3b32f75a54f8",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -2024,10 +2024,10 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "5944f89e-5b70-4b17-af99-09fa63c15f23"
"__uuid__": "9f8f3a2e-e2dd-4d29-92ac-6fb9d1279bca"
},
"_N$dragonAtlasAsset": {
"__uuid__": "2368f043-d708-4d13-886b-6e7d83f98c30"
"__uuid__": "bf5fa08c-7de5-4bf0-857b-3b32f75a54f8"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
......@@ -2035,11 +2035,11 @@
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "acO6TMfKtIv65PTdTqRBUo"
"_id": "0fwSxrpOBAJZWSgAsm50zy"
},
{
"__type__": "cc.Node",
"_name": "hen",
"_name": "house",
"_objFlags": 0,
"_parent": {
"__id__": 14
......@@ -2062,8 +2062,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1007.37,
"height": 596.06
"width": 1143,
"height": 951
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -2081,9 +2081,9 @@
0,
0,
1,
0.25,
0.25,
1
0.22,
0.22,
0.22
]
},
"_eulerAngles": {
......@@ -2097,7 +2097,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "5cQofg3whIsqMKpbpzXhuY"
"_id": "2fvyP6xbtEn7x9BYufNC9G"
},
{
"__type__": "dragonBones.ArmatureDisplay",
......@@ -2113,12 +2113,12 @@
}
],
"_armatureName": "Armature",
"_animationName": "",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "9f8f3a2e-e2dd-4d29-92ac-6fb9d1279bca#bf5fa08c-7de5-4bf0-857b-3b32f75a54f8",
"_armatureKey": "7bb49576-efa4-4634-ae72-9a1691dea9f6#935da5b5-62fd-4317-b654-771501096d80",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
......@@ -2126,18 +2126,18 @@
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "9f8f3a2e-e2dd-4d29-92ac-6fb9d1279bca"
"__uuid__": "7bb49576-efa4-4634-ae72-9a1691dea9f6"
},
"_N$dragonAtlasAsset": {
"__uuid__": "bf5fa08c-7de5-4bf0-857b-3b32f75a54f8"
"__uuid__": "935da5b5-62fd-4317-b654-771501096d80"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "0fwSxrpOBAJZWSgAsm50zy"
"_id": "dfoxaP1BZCaJkl0P1Av6jU"
},
{
"__type__": "cc.Sprite",
......
import { onHomeworkFinish, RandomInt, playAudioByUrl, loadDragonBones } from "../script/util";
import { onHomeworkFinish, RandomInt, playAudioByUrl, loadDragonBones, getSpriteFrimeByUrl } from "../script/util";
import { defaultData } from "../script/defaultData";
import { assign, createMachine, interpret, actions, forwardTo, matchesState } from "../script/xstate";
const { pure , send, raise, sendParent } = actions;
class AssetCacher {
constructor(data, progress, complete) {
this.data = data;
this.obj = JSON.parse(JSON.stringify(data))
this.complete = complete;
this.progress = progress;
}
_extractResource(data) {
if (!Array.isArray(data)) {
data = Object.values(data)
}
const urls = [];
for (var item of data) {
if (typeof item === 'string' && item.startsWith('http')) {
urls.push(item);
continue
}
const us = this._extractResource(item);
for (const u of us) {
urls.push(u)
}
}
return urls
}
_replaceResource(objs, urls, assets) {
const fn = (obj) => {
Object.keys(obj).forEach(key => {
const v = obj[key];
if (typeof v == 'string' && v.startsWith('http')) {
const i = urls.indexOf(v);
if (i > -1) {
obj[key] = assets[i]
}
return
}
if (v){
this._replaceResource(v)
}
})
}
fn(objs);
return objs
}
start() {
const urls = this._extractResource(this.data);
cc.assetManager.loadAny(urls, null, this.progress, (err, data) => {
const objs = [];
for (const asset of data) {
if (asset.constructor.name === 'ImageBitmap') {
const t = new cc.Texture2D()
t.initWithData(asset);
objs.push(t);
} else if (asset.constructor.name === 'AudioBuffer') {
const clip = new cc.AudioClip()
clip._nativeAsset = asset;
objs.push(clip);
}
}
const r = this._replaceResource(JSON.parse(JSON.stringify(this.data)),urls, objs)
this.complete && this.complete();
});
}
}
cc.Class({
extends: cc.Component,
......@@ -142,7 +76,7 @@ cc.Class({
const times = (options && options.times) || 1;
const cb = (options && options.callback) || null;
// const cat = cc.find(`Canvas/frame-border/ground/${node}`);
const node = this._animaNodeList[idx]
const node = this._figurePointRectArray[idx].node
var dragonDisplay = node.getComponent(dragonBones.ArmatureDisplay);
const state = dragonDisplay.playAnimation(name, times);
......@@ -159,17 +93,23 @@ cc.Class({
_imageResList: null,
_audioResList: null,
_animaResList: null,
_animaNodeList : null,
_lastFingerPosition: null,
_hintsNodeList : null,
_figurePointRectArray: null,
initSceneData() {
this._imageResList = [];
this._audioResList = [];
this._animaResList = [];
this._animaNodeList = [];
this._hintsNodeList = [];
this._lastFingerPosition= {
pos: null,
dirty: false
};
this._figurePointRectArray = [];
},
_designSize: null, // 设计分辨率
......@@ -219,7 +159,8 @@ cc.Class({
console.log(`[hint] play question ${ctx.questionIndex}: ${ctx.questionPlayTimes } audio`);
ctx.questionPlayTimes += 1;
return new Promise((resolve,reject) => {
playAudioByUrl(this.data.hotZoneItemArr[ctx.questionIndex].audio_url, () => {
playAudioByUrl(ctx.questions[ctx.questionIndex].audio_url, () => {
console.log('hint finish');
resolve()
})
......@@ -252,39 +193,16 @@ cc.Class({
},
invoke: {
/*src: (ctx) => {
ctx.questionPlayTimes += 1;
const rt = RandomInt(4500, 5500)
console.log('[answer] thinking and playing', rt, rt<5000 ? 'should 1111': '');
return new Promise((resolve,reject) => {
setTimeout(() => {
if(rt < 5000) {
console.log('[answer] finish, go done', rt % 2);
}
if (rt % 2 == 1) {
resolve()
} else {
reject()
}
}, rt)
})
},
onDone: {
target: '#QuestionsArray.next',
actions: raise('CHECK')
},
onError: {
target: 'retry',
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', JSON.stringify(this._lastFingerPosition), JSON.stringify(region.rectPercent), result);
const region = context.questions[context.questionIndex];
const result = this.checkInRegion(region.rect);
console.log('checkInRegion', JSON.stringify(this._lastFingerPosition), JSON.stringify(region.rect), result);
if (result) {
callback('RIGHT')
// playAudioByUrl(this.data.begin_audio, () => {
......@@ -301,40 +219,6 @@ cc.Class({
},
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',
},
......@@ -351,7 +235,11 @@ cc.Class({
this._lastFingerPosition.dirty = false;
return new Promise((resolve, reject) => {
console.log('answer right');
this.playAni(context.questionIndex, 'normal')
// this.playAni(context.questionIndex, 'normal')
const an = context.questions[context.questionIndex].node;
an.active = true;
// const dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay);
// dragonDisplay.playAnimation('normal', 0);
playAudioByUrl(this.rightAudio, () => {
resolve()
})
......@@ -369,14 +257,19 @@ cc.Class({
},
wrong:{
invoke: {
src: (ctx, event) => {
src: (context, event) => {
console.log(1111)
this._lastFingerPosition.pos = null;
this._lastFingerPosition.dirty = false;
return new Promise((resolve, reject) => {
console.log('answer wrong', ctx.questionPlayTimes , ctx.maxQuestionTryTimes);
console.log('answer wrong', context.questionPlayTimes , context.maxQuestionTryTimes);
playAudioByUrl(this.wrongAudio, () => {
if (ctx.questionPlayTimes >= ctx.maxQuestionTryTimes) {
if (context.questionPlayTimes >= context.maxQuestionTryTimes) {
const an = context.questions[context.questionIndex].node;
an.active = true;
console.log(an._id)
// const dragonDisplay = an.getComponent(dragonBones.ArmatureDisplay);
// dragonDisplay.playAnimation('normal', 0);
reject()
} else {
resolve()
......@@ -434,7 +327,8 @@ cc.Class({
questionIndex: 0,
questionPlayTimes: 0,
maxQuestionTryTimes: 2,
questionsCount: this.data.hotZoneItemArr.length,
questionsCount: this._figurePointRectArray.length,
questions: this._figurePointRectArray,
},
states: {
begin: {
......@@ -457,11 +351,14 @@ cc.Class({
}
},
playing: {
entry: () => {
entry: (ctx) => {
console.log('entry play stage');
cc.assetManager.loadRemote(this.data.playing_audio, (err, audioClip) => {
cc.audioEngine.playMusic(audioClip, true, 0.8);
});
ctx.questions.forEach((block) => {
block.node.active = false;
});
},
exit: () => {
console.log('exit play stage');
......@@ -495,21 +392,18 @@ cc.Class({
}
};
const after = {};
for(let i = 0 ;i < this.data.hotZoneItemArr.length; i++) {
const t = this.data.hotZoneItemArr[i];
const k = +t.labelText * 1000;
for(let i = 0 ;i < this._hintsNodeList.length; i++) {
const t = this._hintsNodeList[i].node;
const k = this._hintsNodeList[i].after;
after[k]= {
actions: () => {
console.log(k)
this.playAni(i, 'normal')
// this.playAni(i, 'normal')
cc.tween(t).to(.8, {scale: .3}).to(.8, {scale: .25}).start()
}
}
}
state.states.begin.after = after;
// state.states.begin.after = {
// 1000: { actions: () => {console.log(1000)} },
// 2000: { actions: () => {console.log(2000)} },
// }
const gameMachine = createMachine(state);
window.gameMachine = gameMachine;
......@@ -533,17 +427,7 @@ cc.Class({
console.log('data:', data);
this.data = data || this.getDefaultData();
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()
});
window.air = window.air || {}
......@@ -567,32 +451,6 @@ cc.Class({
},
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;
}
}
}
},
......@@ -635,9 +493,18 @@ cc.Class({
addPreloadImage() {
this._imageResList.push({ url: this.data.bgItem.url});
// this._imageResList.push({ url: this.data.pic_url_2 });
for (const q of this.data.hotZoneItemArr) {
this._audioResList.push({ url: q.texPngData.url });
if (q.gIdx =='0') {
this._imageResList.push({ url: q.texPngData.url});
}
if (q.gIdx =='1') {
this._imageResList.push({ url: q.texPngData.url });
}
if (q.gIdx =='2') {
this._imageResList.push({ url: q.pic_url});
}
}
},
......@@ -649,7 +516,9 @@ cc.Class({
for (const q of this.data.hotZoneItemArr) {
this._audioResList.push({ url: q.audio_url });
if (q.gIdx =='0') {
this._audioResList.push({ url: q.audio_url });
}
}
},
......@@ -660,37 +529,74 @@ cc.Class({
preload() {
const preloadArr = this._imageResList.concat(this._audioResList).concat(this._animaResList);
console.log(preloadArr);
// console.log(preloadArr);
cc.assetManager.loadAny(preloadArr, null, (f, t, item) => {
// console.log(f, t, item)
}, (err, data) => {
console.log(err, data);
// for (const asset of data) {
// if (asset.constructor.name === 'ImageBitmap') {
// const t = new cc.Texture2D()
// t.initWithData(asset);
// } else if (asset.constructor.name === 'AudioBuffer') {
// const clip = new cc.AudioClip()
// 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
});
const baseRect = this.data.bgItem.rect;
getSpriteFrimeByUrl(this.data.bgItem.url, (sf) => {
const gs = ground.getComponent(cc.Sprite);
gs.spriteFrame = sf;
});
for(const block of this.data.hotZoneItemArr) {
if (block.gIdx == '2') {
const s1 = ((ground.width / block.imgSizeW) + (ground.height / block.imgSizeH)) / 2
const node = new cc.Node();
node.parent = ground;
const spr = node.addComponent(cc.Sprite);
getSpriteFrimeByUrl(block.pic_url, (sf) => {
spr.spriteFrame = sf;
node.scale = s1;
})
}
if (block.gIdx == '0' || block.gIdx == '1') {
const n = new cc.Node();
n.scale = 0.25;
const db = n.addComponent(dragonBones.ArmatureDisplay);
loadDragonBones(db, {
tex: block.texPngData.url,
atlas: block.texJsonData.url,
ske: block.skeJsonData.url,
}).then(({width, height}) => {
n.width = width;
n.height = height;
n.parent = ground;
db.playAnimation('normal', 0);
});
if (block.gIdx == '0') {
const rectInfo = {
node: n,
audio_url: block.audio_url ,
rect: {
x: block.rect.x / baseRect.width,
y: block.rect.y / baseRect.height,
width: block.rect.width / baseRect.width,
height: block.rect.height / baseRect.height,
}
};
this._figurePointRectArray.push(rectInfo);
if (block.labelText) {
const k = +block.labelText * 1000;
if(!isNaN(k)) {
this._hintsNodeList.push({
node: n,
after: k
});
}
}
}
}
}
// console.log(this.data);
console.log('resource perload finish');
this.loadEnd();
if (window && window["air"] && window["air"].hideAirClassLoading) {
......@@ -704,8 +610,8 @@ cc.Class({
loadEnd() {
this.initData();
this.initAudio();
this.initView();
// this.initAudio();
// this.initView();
// this.initListener();
this.createStateMachine();
......@@ -717,26 +623,26 @@ cc.Class({
this._cantouch = true;
},
audioBtn: null,
initAudio() {
const audioNode = cc.find('Canvas/res/audio');
// audioBtn: null,
// initAudio() {
// const audioNode = cc.find('Canvas/res/audio');
const getAudioByResName = (resName) => {
return audioNode.getChildByName(resName).getComponent(cc.AudioSource);
}
// const getAudioByResName = (resName) => {
// return audioNode.getChildByName(resName).getComponent(cc.AudioSource);
// }
this.audioBtn = getAudioByResName('btn');
// this.audioBtn = getAudioByResName('btn');
},
// },
initView() {
// initView() {
this.initBg();
this.initPic();
this.initBtn();
this.initIcon();
},
// // this.initBg();
// // this.initPic();
// // this.initBtn();
// this.initIcon();
// },
initBg() {
const bgNode = cc.find('Canvas/bg');
......@@ -744,64 +650,10 @@ cc.Class({
console.log('this._mapScaleMax', this._mapScaleMax);
},
pic1: null,
pic2: null,
initPic() {
const canvas = cc.find('Canvas');
const maxW = canvas.width * 0.7;
// this.getSprNodeByUrl(this.data.pic_url, (sprNode) => {
// const picNode1 = sprNode;
// picNode1.scale = maxW / picNode1.width;
// picNode1.baseX = picNode1.x;
// canvas.addChild(picNode1);
// this.pic1 = picNode1;
// const labelNode = new cc.Node();
// labelNode.color = cc.Color.YELLOW;
// const label = labelNode.addComponent(cc.Label);
// label.string = this.data.text;
// label.fontSize = 60;
// label.lineHeight = 60;
// label.font = cc.find('Canvas/res/font/BRLNSDB').getComponent('cc.Label').font;
// picNode1.addChild(labelNode);
// });
// this.getSprNodeByUrl(this.data.pic_url_2, (sprNode) => {
// const picNode2 = sprNode;
// picNode2.scale = maxW / picNode2.width;
// canvas.addChild(picNode2);
// picNode2.x = canvas.width;
// picNode2.baseX = picNode2.x;
// this.pic2 = picNode2;
// const labelNode = new cc.Node();
// const label = labelNode.addComponent(cc.RichText);
// const size = 60
// 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.lineHeight = size;
// picNode2.addChild(labelNode);
// });
},
initIcon() {
// const iconNode = this.getSprNode('icon');
// iconNode.zIndex = 5;
// iconNode.anchorX = 1;
// iconNode.anchorY = 1;
// iconNode.parent = cc.find('Canvas');
// iconNode.x = iconNode.parent.width / 2 - 10;
// iconNode.y = iconNode.parent.height / 2 - 10;
// iconNode.on(cc.Node.EventType.TOUCH_START, () => {
// this.playAudioByUrl(this.data.audio_url);
// })
},
curPage: null,
initBtn() {
/*initBtn() {
this.curPage = 0;
const bottomPart = cc.find('Canvas/bottomPart');
......@@ -843,43 +695,12 @@ cc.Class({
cc.audioEngine.play(this.audioBtn.clip, false, 0.5)
})
},
leftMove() {
// this._cantouch = false;
// const len = this.pic1.parent.width;
// cc.tween(this.pic1)
// .to(1, { x: this.pic1.baseX }, { easing: 'cubicInOut' })
// .start();
// cc.tween(this.pic2)
// .to(1, { x: this.pic2.baseX }, { easing: 'cubicInOut' })
// .call(() => {
// this._cantouch = true;
// })
// .start();
},
rightMove() {
// this._cantouch = false;
// const len = this.pic1.parent.width;
// cc.tween(this.pic1)
// .to(1, { x: this.pic1.baseX - len }, { easing: 'cubicInOut' })
// .start();
// cc.tween(this.pic2)
// .to(1, { x: this.pic2.baseX - len }, { easing: 'cubicInOut' })
// .call(() => {
// this._cantouch = true;
// })
// .start();
},
// update (dt) {},
},*/
// update (dt) {},
......@@ -899,48 +720,10 @@ cc.Class({
// ------------------------------------------------
getSprNode(resName) {
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
return node;
},
getSpriteFrimeByUrl(url, cb) {
cc.loader.load({ url }, (err, img) => {
const spriteFrame = new cc.SpriteFrame(img)
if (cb) {
cb(spriteFrame);
}
})
},
getSprNodeByUrl(url, cb) {
const node = new cc.Node();
const spr = node.addComponent(cc.Sprite);
this.getSpriteFrimeByUrl(url, (sf) => {
spr.spriteFrame = sf;
if (cb) {
cb(node);
}
})
},
playAudioByUrl(audio_url, cb = null) {
if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => {
cb();
});
}
});
}
},
// ------------------------------------------
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment