Commit 06309eb6 authored by 王炽's avatar 王炽

5555555

parent 55cac8e5
No preview for this file type
......@@ -38,7 +38,7 @@
this.viewContainer.width = props.viewWidth;
this.viewContainer.height = props.viewHeight;
this.bgImg = new engine.Image();
this.bgImg.source = engine.getAssetByName("rock-背景").url;
this.bgImg.source = getAssetByName("rock-背景").url;
this.viewContainer.addChild(this.bgImg);
this.container0 = new engine.Container();
this.container1 = new engine.Container();
......@@ -148,7 +148,20 @@
}
}
for (var i = 0; i < 3; i++) {
this.itemInfo["items" + i][1].texture = engine.Texture.fromImage(this.getPrizeUrl(this.prizeId));
var p = this.itemInfo["items" + i][1].parent;
p.removeChild(this.itemInfo["items" + i][1]);
var ix = this.itemInfo["items" + i][1].x;
var iy = this.itemInfo["items" + i][1].y;
var iw = this.itemInfo["items" + i][1].width;
var ih = this.itemInfo["items" + i][1].height;
var nItem = new engine.Sprite();
nItem.texture = engine.Texture.fromImage(this.getPrizeUrl(this.prizeId));
this.itemInfo["items" + i][1] = nItem;
nItem.x = ix;
nItem.y = iy;
nItem.width = iw;
nItem.height = ih;
p.addChild(nItem);
}
};
GameView.prototype.getPrizeUrl = function (pid) {
......
This diff is collapsed.
......@@ -138,7 +138,7 @@ export default class GameView extends engine.Container {
// this.bgImg = new engine.Sprite(getTextureByName('rock-背景'));
this.bgImg = new engine.Image();
this.bgImg.source = engine.getAssetByName("rock-背景").url;
this.bgImg.source = getAssetByName("rock-背景").url;
this.viewContainer.addChild(this.bgImg);
this.container0 = new engine.Container();
......@@ -285,7 +285,27 @@ export default class GameView extends engine.Container {
for(let i = 0; i < 3; i++){
// this.prizeId = "sss_3";
this.itemInfo["items" + i][1].texture = engine.Texture.fromImage(this.getPrizeUrl(this.prizeId));
// this.itemInfo["items" + i][1].texture = engine.Texture.fromImage(this.getPrizeUrl(this.prizeId));
let p = this.itemInfo["items" + i][1].parent;
p.removeChild(this.itemInfo["items" + i][1]);
let ix = this.itemInfo["items" + i][1].x;
let iy = this.itemInfo["items" + i][1].y;
let iw = this.itemInfo["items" + i][1].width;
let ih = this.itemInfo["items" + i][1].height;
let nItem = new engine.Sprite();
nItem.texture = engine.Texture.fromImage(this.getPrizeUrl(this.prizeId));
this.itemInfo["items" + i][1] = nItem;
nItem.x = ix;
nItem.y = iy;
nItem.width = iw;
nItem.height = ih;
p.addChild(nItem);
// this.itemInfo["items" + i][1].source = this.getPrizeUrl(this.prizeId);
}
......
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