Commit e25801d1 authored by zjz1994's avatar zjz1994

红包炸弹大小调整

parent 21b3fade
......@@ -105,7 +105,8 @@ export default class RedBombAlertPanel extends Panel {
}, this);
});
}
prizeMv:any;
isShow:boolean = true;
playPrizeAni() {
loadSvga(getResPath() + 'resource/assets/svgas/redbomb_prize.svga').then(async (mv: any) => {
mv.y = this.alertHeight;
......@@ -158,10 +159,75 @@ export default class RedBombAlertPanel extends Panel {
}, 1700);
// for(var mvkey=0;mvkey<mv.)
mv.setImage("815207F0-919C-4796-A09E-21868AF337CB", img);
this.isShow = isShow;
this.prizeMv = mv;
if(!this.isShow){
let changeimg = this.getchangeImg();
if(changeimg){
//500*233
var imgwid = 550;
var imghei = 256;
changeimg.anchorOffsetX = imgwid/2;
changeimg.anchorOffsetY = imghei/2;
// var cx = changeimg.x;
// var cy = changeimg.y;
// cx += 500/2;
// cy += 500/2;
changeimg.width = imgwid;
changeimg.height = imghei;
// changeimg.x = cx;
// changeimg.y = cy;
}
egret.startTick(this.update,this);
}else{
egret.stopTick(this.update,this);
}
}, 100)
});
}
getchangeImg(){
if(this.prizeMv){
let changeimg:egret.Bitmap;
for (var i = 0; i < this.prizeMv.$children.length; i++) {
var n = this.prizeMv.$children[i];
if(n.imageKey == "815207F0-919C-4796-A09E-21868AF337CB"){
changeimg = n;
break;
}
}
return changeimg;
}
}
update(t){
if(this.prizeMv&&!this.isShow){
let changeimg = this.getchangeImg();
if(!changeimg){
return false;
}
var curframe = this.prizeMv.currentFrame;
if(curframe>=180){
changeimg.x = 382;
changeimg.y = 375;
return false;
}
var sx = changeimg.x;
var sy = changeimg.y;
// sx += 500/2;
sy += changeimg.scaleY*233/2;
changeimg.x = 382;
changeimg.y = sy;
// console.log("测试红包图",this.prizeMv,sx,sy,this.prizeMv.currentFrame,"宽高设置:"+changeimg.width,changeimg.height);
// console.error("缩放设置",changeimg.scaleX,changeimg.scaleY);
}
return false;
}
protected get closeBtns(): eui.Button[] {
return [this['closeBtn']]
}
......
......@@ -673,8 +673,8 @@ const chapterFuns = {
[5,6]
],
msg: [
"冰下食物消除1",
"冰下食物消除2"
"冰块下藏着一个东西,快消除看看是什么~",
"原来是一块饼干,继续消除它身上的冰块吧~"
]
},
};
......
{
"code":"0000000000",
"data":{
"remain": 0,
"remain": 10,
"redBombSwitchTime": "77798963487234"
},
"desc":"OK",
......
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