Commit 89d466f9 89d466f986c9faaa58ecea401c512761729b4184 by jinwawa

fix sceneExploreNew blank screen

1 parent 600ab8e3
......@@ -13,6 +13,7 @@ cc.Class({
extends: TVCanvas,
properties: {
_speed: 0,
PFB_TYPE: {
default: null,
type: cc.Prefab,
......@@ -24,7 +25,7 @@ cc.Class({
},
start: function () {
this.bg_long.getComponent(cc.Animation).play(); //播放动画
// this.bg_long.getComponent(cc.Animation).play(); //动画滚动背景,因为动画背景尺寸较大,再真机中黑屏
// this.schedule(()=>{
// this.bg_long.getComponent(cc.Animation).pause(); //暂停播放动画
......@@ -43,6 +44,13 @@ cc.Class({
this._islandOrder = oSceneParameter.order-1; //当前位于哪个岛屿,岛屿从1开始排序,故需要-1
}
//------------------滚动背景-------------------
this._speed=0;
this.bg_1 = this.node.getChildByName("bg_1");
this.bg_2 = this.node.getChildByName("bg_2");
this.cur_bg = this.bg_1;
//---------------------------------------------
this._aFocusTargets[1] = []; //弹窗焦点
this._iSceneStatus = 0; //焦点层级
this._remindString = this.node.getChildByName("Remind").getComponent(cc.Label);
......@@ -186,11 +194,13 @@ cc.Class({
}, 3);
return;
}
this.bg_long.getComponent(cc.Animation).resume(); //播放动画
// this.bg_long.getComponent(cc.Animation).resume(); //播放动画
this._speed=1;
this.hero.getComponent(dragonBones.ArmatureDisplay).playAnimation("Animation1");
this.scheduleOnce(() => {
this.bg_long.getComponent(cc.Animation).pause(); //暂停播放动画
// this.bg_long.getComponent(cc.Animation).pause(); //暂停播放动画
this._speed=0;
// this.hero.getComponent(dragonBones.ArmatureDisplay)._armature.animation.stop(); //APK不支持
this.hero.getComponent(dragonBones.ArmatureDisplay).playAnimation("Animation1").stop();
......@@ -319,5 +329,18 @@ cc.Class({
}
},
update: function (dt) {
this.bg_1.x -= this._speed;
this.bg_2.x -= this._speed;
if (this.cur_bg.x <= -1984) {
if (this.cur_bg == this.bg_2) {
this.bg_2.x = this.bg_1.x + 1984;
this.cur_bg = this.bg_1;
} else {
this.bg_1.x = this.bg_2.x + 1970;
this.cur_bg = this.bg_2;
}
}
},
});
......
{
"ver": "2.2.0",
"uuid": "154f1aad-5677-4723-a6ea-bed25fb67b49",
"uuid": "5e6b1288-3d11-4862-bb65-51200bdf45e4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"subMetas": {
"explore_plus1": {
"explore_big": {
"ver": "1.0.4",
"uuid": "2a6ce217-b4e3-4c8e-8b70-c8b93ef28c80",
"rawTextureUuid": "154f1aad-5677-4723-a6ea-bed25fb67b49",
"uuid": "3f32828b-9061-48fb-a658-e2239afbc62a",
"rawTextureUuid": "5e6b1288-3d11-4862-bb65-51200bdf45e4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
......@@ -17,10 +17,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 912,
"height": 1110,
"rawWidth": 912,
"rawHeight": 1110,
"width": 1984,
"height": 1108,
"rawWidth": 1984,
"rawHeight": 1108,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
{
"ver": "2.2.0",
"uuid": "08ea60a8-ed09-414d-aa25-34e6139d2942",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"subMetas": {
"explore_plus2": {
"ver": "1.0.4",
"uuid": "b9ee3250-661a-448e-8e7b-cf4dd91afe8e",
"rawTextureUuid": "08ea60a8-ed09-414d-aa25-34e6139d2942",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1520,
"height": 720,
"rawWidth": 1520,
"rawHeight": 720,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -1804,6 +1804,7 @@ e("ListView"), e("ListCell"), e("xmlToJSON"), e("GlobalValue"));
cc.Class({
extends: a,
properties: {
_speed: 0,
PFB_TYPE: {
default: null,
type: cc.Prefab
......@@ -1815,7 +1816,6 @@ type: cc.Prefab
},
start: function() {
var e = this;
this.bg_long.getComponent(cc.Animation).play();
this.scheduleOnce(function() {
e.bg_long.getComponent(cc.Animation).pause();
}, 0);
......@@ -1824,6 +1824,10 @@ onLoad: function() {
this._super();
var e = this._cApplication.getTopSceneParameter();
e && (this._islandOrder = e.order - 1);
this._speed = 0;
this.bg_1 = this.node.getChildByName("bg_1");
this.bg_2 = this.node.getChildByName("bg_2");
this.cur_bg = this.bg_1;
this._aFocusTargets[1] = [];
this._iSceneStatus = 0;
this._remindString = this.node.getChildByName("Remind").getComponent(cc.Label);
......@@ -1915,10 +1919,10 @@ this.backAScene();
nextTask: function() {
var e = this;
if (5 != this.totalTask) {
this.bg_long.getComponent(cc.Animation).resume();
this._speed = 1;
this.hero.getComponent(dragonBones.ArmatureDisplay).playAnimation("Animation1");
this.scheduleOnce(function() {
e.bg_long.getComponent(cc.Animation).pause();
e._speed = 0;
e.hero.getComponent(dragonBones.ArmatureDisplay).playAnimation("Animation1").stop();
var t = e.random(1, 7);
cc.log("随机数--------\x3e" + t);
......@@ -2020,6 +2024,17 @@ this.doTVLinkAction(i[n]);
} catch (e) {
cc.log("runTVLinkAction Exception..." + e);
}
},
update: function(e) {
this.bg_1.x -= this._speed;
this.bg_2.x -= this._speed;
if (this.cur_bg.x <= -1984) if (this.cur_bg == this.bg_2) {
this.bg_2.x = this.bg_1.x + 1984;
this.cur_bg = this.bg_1;
} else {
this.bg_1.x = this.bg_2.x + 1970;
this.cur_bg = this.bg_2;
}
}
});
cc._RF.pop();
......