var bg = new Laya.Sprite();
bg.loadImage("res/bg-480x720.jpg");
Laya.stage.on(Laya.Event.RESIZE,this,onResize);
function onResize() {
var scale,scaleX,scaleY;
scaleX = Browser.clientWidth/480;
scaleY = Browser.clientHeight/720;
scale = scaleX > scaleY ? scaleX : scaleY;
bg.scale(scale,scale);
bg.pivotX = bg.getBounds().width/2;
bg.pivotY = bg.getBounds().height/2;
}
不加pivotX这两行的时候是正常的,加了后变成这样了。。是什么原因呢?