[LayaAir 2.0]用Transform和直接设置xy坐标的效果不一致
LayaAir2.0直接设置坐标的效果是正确的,设置transform不正确。在LayaAir1.x两个效果都是一致的。
let txt: Laya.Text = new Laya.Text();
txt.text = "HELLO";
txt.color = "#ffffff";
txt.x = 1136 / 2, txt.y = 320;
Laya.stage.addChild(txt);
txt = new Laya.Text();
txt.text = "HELLO";
txt.color = "#ffffff";
let mat = new Laya.Matrix();
mat.translate(1136 / 2, 320);
txt.transform = mat;
Laya.stage.addChild(txt);
let txt: Laya.Text = new Laya.Text();
txt.text = "HELLO";
txt.color = "#ffffff";
txt.x = 1136 / 2, txt.y = 320;
Laya.stage.addChild(txt);
txt = new Laya.Text();
txt.text = "HELLO";
txt.color = "#ffffff";
let mat = new Laya.Matrix();
mat.translate(1136 / 2, 320);
txt.transform = mat;
Laya.stage.addChild(txt);
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
carylee
赞同来自: