Commit 87c4450b authored by asdf's avatar asdf

火车初始位置

parent 086a6167
...@@ -259,8 +259,8 @@ ...@@ -259,8 +259,8 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 0, "width": 1100,
"height": 0 "height": 646
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
...@@ -311,11 +311,11 @@ ...@@ -311,11 +311,11 @@
], ],
"_armatureName": "", "_armatureName": "",
"_animationName": "", "_animationName": "",
"_preCacheMode": -1, "_preCacheMode": 0,
"_cacheMode": 0, "_cacheMode": 0,
"playTimes": -1, "playTimes": -1,
"premultipliedAlpha": false, "premultipliedAlpha": false,
"_armatureKey": "", "_armatureKey": "179808f9-d84c-4a2b-a3c1-5d3c5d002992#e3095326-81fc-4cbf-8810-a4ee76c30843",
"_accTime": 0, "_accTime": 0,
"_playCount": 0, "_playCount": 0,
"_frameCache": null, "_frameCache": null,
...@@ -370,7 +370,7 @@ ...@@ -370,7 +370,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 196.52, "width": 15.35,
"height": 100 "height": 100
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -417,7 +417,7 @@ ...@@ -417,7 +417,7 @@
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 196.52, "width": 15.35,
"height": 100 "height": 100
}, },
"_resize": 1, "_resize": 1,
...@@ -668,7 +668,7 @@ ...@@ -668,7 +668,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-160.545, -180.484,
0, 0,
0, 0,
0, 0,
......
...@@ -63,6 +63,8 @@ cc.Class({ ...@@ -63,6 +63,8 @@ cc.Class({
} }
this.dragonBone.armatureName = data.name; this.dragonBone.armatureName = data.name;
this.animationName = data.animation[0].name; this.animationName = data.animation[0].name;
this.setSpineScale(data.canvas);
} }
}); });
} }
...@@ -70,6 +72,20 @@ cc.Class({ ...@@ -70,6 +72,20 @@ cc.Class({
}, },
setSpineScale(size) {
let bgWidth = 250;
let bgHeight = 250;
if (size.width != bgWidth || size.height != bgHeight) {
let designScale = bgWidth / bgHeight;
let scale = size.width / size.height;
if (scale > designScale) {
this.dragonBone.node.scale = bgWidth / size.width;
} else {
this.dragonBone.node.scale = bgHeight / size.height;
}
}
},
initLetters() { initLetters() {
let text = this.item.text; let text = this.item.text;
for (let i = 0; i < text.length; i++) { for (let i = 0; i < text.length; i++) {
......
...@@ -224,7 +224,7 @@ cc.Class({ ...@@ -224,7 +224,7 @@ cc.Class({
}, },
initLayerTrainPosition() { initLayerTrainPosition() {
this.layerTrain.x = cc.view.getVisibleSize().width / 2 - 1220; this.layerTrain.x = cc.view.getVisibleSize().width / 2 - 1280;
this.dragonBone.playAnimation('normal', -1); this.dragonBone.playAnimation('normal', -1);
}, },
......
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