[]【laya2.0】加载并且显示图片,并且让该图片居于舞台中央,怎么写?

已邀请:

hj

赞同来自:

var logo = new Laya.Sprite();
Laya.stage.addChild(logo);
logo.loadImage("res/atlas/test.png", Laya.Handler.create(this, function(){
console.log("complete!!");
logo.x= Laya.stage.width/2-logo.width/2;
logo.y= Laya.stage.height/2-logo.height/2;
//logo.pos(Laya.stage.width/2-logo.width/2,Laya.stage.height/2-logo.height/2);
}));

hj

赞同来自:

你用这个方法的时候,鼠标在这停留一秒钟就能看见

要回复问题请先

商务合作
商务合作