Commit 0c730d0d authored by liujiangnan's avatar liujiangnan

feat: 箭头点击和骨骼动画

parent b48ccac3
{"frameRate":24,"name":"左滑","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"Armature","aabb":{"x":-54,"y":-42,"width":98,"height":84},"bone":[{"name":"root"},{"length":143,"name":"bone","parent":"root","transform":{"x":45.1,"y":1.4,"skX":179.9199,"skY":179.9199}}],"slot":[{"displayIndex":1,"name":"图层1","parent":"bone"},{"name":"圆角矩形_5_拷贝_5(3)","parent":"bone"},{"name":"圆角矩形_5_拷贝_5(2)","parent":"bone"}],"skin":[{"slot":[{"name":"圆角矩形_5_拷贝_5(2)","display":[{"name":"右滑/圆角矩形_5_拷贝_5(2)","transform":{"x":76.1,"y":1.51,"skX":-179.92,"skY":-179.92}},{"name":"右滑/圆角矩形_5_拷贝_5","transform":{"x":76.1,"y":1.51,"skX":-179.92,"skY":-179.92}}]},{"name":"圆角矩形_5_拷贝_5(3)","display":[{"name":"右滑/圆角矩形_5_拷贝_5(3)","transform":{"x":45.1,"y":1.46,"skX":-179.92,"skY":-179.92}},{"name":"右滑/圆角矩形 5 拷贝 5_0","transform":{"x":45.6,"y":1.46,"skX":-179.92,"skY":-179.92}}]},{"name":"图层1","display":[{"name":"右滑/图层1","transform":{"x":16.1,"y":1.42,"skX":-179.92,"skY":-179.92}},{"name":"右滑/图层1(2)","transform":{"x":16.1,"y":1.42,"skX":-179.92,"skY":-179.92}}]}]}],"animation":[{"duration":24,"playTimes":0,"name":"normal","bone":[{"name":"bone","translateFrame":[{"duration":24,"x":-99.7}],"scaleFrame":[{"duration":24,"x":-1}]}],"slot":[{"name":"图层1","displayFrame":[{"duration":18,"value":1},{"duration":6},{"duration":0,"value":1}]},{"name":"圆角矩形_5_拷贝_5(3)","displayFrame":[{"duration":12},{"duration":6,"value":1},{"duration":6}]},{"name":"圆角矩形_5_拷贝_5(2)","displayFrame":[{"duration":6},{"duration":6,"value":1},{"duration":12}]}]}],"defaultActions":[{"gotoAndPlay":"normal"}]}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "49bd8dfe-8a3e-495b-8de7-780883ac867f",
"subMetas": {}
}
\ No newline at end of file
{"SubTexture":[{"width":30,"y":75,"height":50,"name":"右滑/图层1","x":129},{"width":30,"y":75,"height":50,"name":"右滑/图层1(2)","x":97},{"y":1,"frameX":-1,"frameHeight":72,"frameY":0,"width":40,"frameWidth":41,"height":72,"name":"右滑/圆角矩形 5 拷贝 5_0","x":97},{"width":40,"y":1,"height":72,"name":"右滑/圆角矩形_5_拷贝_5(3)","x":139},{"width":46,"y":1,"height":84,"name":"右滑/圆角矩形_5_拷贝_5(2)","x":49},{"width":46,"y":1,"height":84,"name":"右滑/圆角矩形_5_拷贝_5","x":1}],"width":256,"imagePath":"left_tex.png","height":128,"name":"左滑"}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "b71597d1-c2ac-4fce-a82e-087d4a5299be",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "0779200f-74f7-4d68-b5db-40507342f840",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 128,
"platformSettings": {},
"subMetas": {
"left_tex": {
"ver": "1.0.4",
"uuid": "bce6ed71-a06d-4b35-b28e-0428fe9dd8f4",
"rawTextureUuid": "0779200f-74f7-4d68-b5db-40507342f840",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -38,
"offsetY": 1,
"trimX": 1,
"trimY": 1,
"width": 178,
"height": 124,
"rawWidth": 256,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{"frameRate":24,"name":"右滑","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":24,"name":"Armature","aabb":{"x":-54,"y":-42,"width":98,"height":84},"bone":[{"name":"root"},{"length":143,"name":"bone","parent":"root","transform":{"x":45.1,"y":1.4,"skX":179.9199,"skY":179.9199}}],"slot":[{"displayIndex":1,"name":"图层1","parent":"bone"},{"name":"圆角矩形_5_拷贝_5(3)","parent":"bone"},{"name":"圆角矩形_5_拷贝_5(2)","parent":"bone"}],"skin":[{"slot":[{"name":"圆角矩形_5_拷贝_5(3)","display":[{"name":"右滑/圆角矩形_5_拷贝_5(3)","transform":{"x":45.1,"y":1.46,"skX":-179.92,"skY":-179.92}},{"name":"右滑/圆角矩形 5 拷贝 5_0","transform":{"x":45.6,"y":1.46,"skX":-179.92,"skY":-179.92}}]},{"name":"圆角矩形_5_拷贝_5(2)","display":[{"name":"右滑/圆角矩形_5_拷贝_5(2)","transform":{"x":76.1,"y":1.51,"skX":-179.92,"skY":-179.92}},{"name":"右滑/圆角矩形_5_拷贝_5","transform":{"x":76.1,"y":1.51,"skX":-179.92,"skY":-179.92}}]},{"name":"图层1","display":[{"name":"右滑/图层1","transform":{"x":16.1,"y":1.42,"skX":-179.92,"skY":-179.92}},{"name":"右滑/图层1(2)","transform":{"x":16.1,"y":1.42,"skX":-179.92,"skY":-179.92}}]}]}],"animation":[{"duration":24,"playTimes":0,"name":"normal","slot":[{"name":"图层1","displayFrame":[{"duration":18,"value":1},{"duration":6},{"duration":0,"value":1}]},{"name":"圆角矩形_5_拷贝_5(3)","displayFrame":[{"duration":12},{"duration":6,"value":1},{"duration":6}]},{"name":"圆角矩形_5_拷贝_5(2)","displayFrame":[{"duration":6},{"duration":6,"value":1},{"duration":12}]}]}],"defaultActions":[{"gotoAndPlay":"normal"}]}]}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "a726e2c8-b3b9-4110-902f-be77899ec05a",
"subMetas": {}
}
\ No newline at end of file
{"SubTexture":[{"width":30,"y":75,"height":50,"name":"右滑/图层1(2)","x":129},{"width":30,"y":75,"height":50,"name":"右滑/图层1","x":97},{"y":1,"frameX":-1,"frameY":0,"width":40,"frameWidth":41,"height":72,"name":"右滑/圆角矩形 5 拷贝 5_0","frameHeight":72,"x":97},{"width":40,"y":1,"height":72,"name":"右滑/圆角矩形_5_拷贝_5(3)","x":139},{"width":46,"y":1,"height":84,"name":"右滑/圆角矩形_5_拷贝_5(2)","x":1},{"width":46,"y":1,"height":84,"name":"右滑/圆角矩形_5_拷贝_5","x":49}],"width":256,"height":128,"name":"右滑","imagePath":"right_tex.png"}
\ No newline at end of file
{
"ver": "1.0.1",
"uuid": "eadc4df6-be3e-4c24-8a1e-66722c1fd542",
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "245d3ab3-47b4-4b1b-9b77-61bc98d915d2",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 256,
"height": 128,
"platformSettings": {},
"subMetas": {
"right_tex": {
"ver": "1.0.4",
"uuid": "b37fc03f-a81e-427b-a63b-b617c1f3f2cd",
"rawTextureUuid": "245d3ab3-47b4-4b1b-9b77-61bc98d915d2",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -38,
"offsetY": 1,
"trimX": 1,
"trimY": 1,
"width": 178,
"height": 124,
"rawWidth": 256,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -78,13 +78,13 @@
"_active": true,
"_components": [
{
"__id__": 78
"__id__": 80
},
{
"__id__": 79
"__id__": 81
},
{
"__id__": 80
"__id__": 82
}
],
"_prefab": null,
......@@ -260,19 +260,19 @@
"__id__": 66
},
{
"__id__": 69
"__id__": 70
},
{
"__id__": 72
"__id__": 74
}
],
"_active": true,
"_components": [
{
"__id__": 76
"__id__": 78
},
{
"__id__": 77
"__id__": 79
}
],
"_prefab": null,
......@@ -3483,6 +3483,9 @@
},
{
"__id__": 68
},
{
"__id__": 69
}
],
"_prefab": null,
......@@ -3496,8 +3499,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 97,
"height": 83
"width": 98,
"height": 84
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -3508,8 +3511,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-495,
35,
-510.39699999999993,
0,
0,
0,
0,
......@@ -3531,10 +3534,10 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "eeEy3oiwZCnq6hGOreHlWY"
"_id": "baS5uRdnNCjYJ4tzevLhES"
},
{
"__type__": "cc.Sprite",
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
......@@ -3546,24 +3549,32 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b54dc5ad-f87a-4546-902a-7489f01aefab"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "04frnoIpRMNZ6B26DyGhav"
"_armatureName": "Armature",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "49bd8dfe-8a3e-495b-8de7-780883ac867f#b71597d1-c2ac-4fce-a82e-087d4a5299be",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "49bd8dfe-8a3e-495b-8de7-780883ac867f"
},
"_N$dragonAtlasAsset": {
"__uuid__": "b71597d1-c2ac-4fce-a82e-087d4a5299be"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "6bUt9Xz0lAPLSeQMpnap1T"
},
{
"__type__": "cc.Widget",
......@@ -3576,10 +3587,10 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 12,
"_left": 96.5,
"_left": 80.60300000000007,
"_right": 0,
"_top": 283.5,
"_bottom": 353.5,
"_top": 0,
"_bottom": 318,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
......@@ -3589,8 +3600,78 @@
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 83,
"_id": "bckqPuJrlNW4z66BNltLcH"
"_originalHeight": 0,
"_id": "e67W02C1RFrL+MriiRdrsf"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
},
"_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": {
"__id__": 66
},
"_id": "bbh+7aXA9Np7ZbiH25t+bR"
},
{
"__type__": "cc.Node",
......@@ -3603,10 +3684,13 @@
"_active": true,
"_components": [
{
"__id__": 70
"__id__": 71
},
{
"__id__": 71
"__id__": 72
},
{
"__id__": 73
}
],
"_prefab": null,
......@@ -3632,8 +3716,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
475,
35,
502.38,
0,
0,
0,
0,
......@@ -3655,14 +3739,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "28bCD+ru1Jd6lxFHiEBmmR"
"_id": "bfKB9oaYtAW4SGkugfKQqI"
},
{
"__type__": "cc.Sprite",
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 69
"__id__": 70
},
"_enabled": true,
"_materials": [
......@@ -3670,40 +3754,48 @@
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a0e0bf64-61fd-4600-8e32-40232e778401"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "81h5tyJo5OvI2doq/H6aN3"
"_armatureName": "Armature",
"_animationName": "normal",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": -1,
"premultipliedAlpha": false,
"_armatureKey": "a726e2c8-b3b9-4110-902f-be77899ec05a#eadc4df6-be3e-4c24-8a1e-66722c1fd542",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "a726e2c8-b3b9-4110-902f-be77899ec05a"
},
"_N$dragonAtlasAsset": {
"__uuid__": "eadc4df6-be3e-4c24-8a1e-66722c1fd542"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "71S1IXoTRJxauAfAqYKsOD"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 69
"__id__": 70
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 36,
"_left": 0,
"_right": 116,
"_top": 283,
"_bottom": 353,
"_right": 88.62,
"_top": 0,
"_bottom": 318,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
......@@ -3713,8 +3805,78 @@
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 84,
"_id": "970IOH5qhBBoOe8jBaFZ8/"
"_originalHeight": 0,
"_id": "ectGeAcclC3pKiZWqU3Fou"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 70
},
"_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": {
"__id__": 70
},
"_id": "480gO4boBKc7ceuUEYEEG1"
},
{
"__type__": "cc.Node",
......@@ -3727,13 +3889,13 @@
"_active": true,
"_components": [
{
"__id__": 73
"__id__": 75
},
{
"__id__": 74
"__id__": 76
},
{
"__id__": 75
"__id__": 77
}
],
"_prefab": null,
......@@ -3789,7 +3951,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
"__id__": 74
},
"_enabled": true,
"_materials": [
......@@ -3821,7 +3983,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
"__id__": 74
},
"_enabled": true,
"alignMode": 1,
......@@ -3848,7 +4010,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
"__id__": 74
},
"_enabled": true,
"_normalMaterial": null,
......
......@@ -183,6 +183,21 @@ export default class SceneComponent extends MyCocosSceneComponent {
initListener() {
this.node.on('touchstart', this.onEventStart, this);
this.node.on('touchend', this.onEventEnd, this);
const left = cc.find('Canvas/bg/left');
buttonOnClick(left, () => {
if (!this._cantouch) {
return;
}
this.rightMove();
});
const right = cc.find('Canvas/bg/right');
buttonOnClick(right, () => {
if (!this._cantouch) {
return;
}
this.leftMove();
});
}
touchX;
......
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