[]为啥 增加 Text ,drawcall 暴增 ??????????????
为啥 增加 Text ,drawcall 暴增 ??????????????
fish.scoreItem = new Laya.Image();
fish.scoreItem.skin = "assets/ui_imgs/img_10103.png";
fish.scoreItem.sizeGrid = '0,10,0,10';
var price = this.getFishVal('10001', 3);
var length = String(price).length;
var w = length * 16 + 15 + 40;
fish.scoreItem.width = w;
fish.scoreItem.x = fish.getBox().x - fish.scoreItem.width/2;
fish.scoreItem.y = fish.getBox().y - fish.scoreItem.height;
this.scoreBox.addChild(fish.scoreItem);
fish.scoreGold = new Laya.Image();
fish.scoreGold.skin = "assets/ui_imgs/icon_00312.png";
fish.scoreGold.x = fish.scoreItem.x;
fish.scoreGold.y = fish.scoreItem.y;
fish.scoreGold.scaleX = 0.6;
fish.scoreGold.scaleY = 0.6;
this.scoreBox.addChild(fish.scoreGold);
// 价格
fish.scoreText = new Laya.Text();
fish.scoreText.font = "fnt_10103";
// fish.scoreText.cacheAs = 'bitmap';
fish.scoreText.x = fish.scoreGold.width + fish.scoreGold.x - 4;
fish.scoreText.y = fish.scoreGold.y + 2;
fish.scoreText.text = price;
this.scoreBox.addChild(fish.scoreText);
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
180*****858
赞同来自: