[]???????? 为啥加一个 Text,drawcall 暴增?

        fish.scoreItem = new Laya.Image();
fish.scoreItem.skin = "assets/ui_imgs/icon_00313.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.x = fish.scoreGold.width + fish.scoreGold.x - 4;
fish.scoreText.y = fish.scoreGold.y + 2;
fish.scoreText.text = price;
this.scoreBox.addChild(fish.scoreText);
 
两种效果 就是 Text 这个引起的,这是为啥呢
this.scoreBox.addChild(fish.scoreText); 
企业微信截图_15265351117651.png 企业微信截图_15265349274513.png
已邀请:

kezhiyu

赞同来自:

text不是图片,所以增加一个text就会增加一次drawcall,可以理解为渲染一个文本的效率不如图片

要回复问题请先

商务合作
商务合作