[LayaAir 1.0]圆环不跟随 sprite 一起缩放?

直线可跟随滚轮缩放, 圆环不缩放,具体见代码
 
 
import WebGL = Laya.WebGL;
import Browser = Laya.Browser;
import Point = Geometry.Point; 
// 程序入口
class GameMain{
constructor()
{
Laya.init(Browser.width, Browser.height, WebGL);
this.CreateCircle();
// this.CreateRectangle();
}
private firstSp: Laya.Sprite;
private _adaptSp: Laya.Sprite;
private _pointList : Point[];
private _rootSp : Laya.Sprite; 
public CreateCircle() {
this._rootSp = new Laya.Sprite(); 
this.firstSp = new Laya.Sprite();
this.firstSp.graphics.drawRect(0, -100, 200, 200, null, "#ffffff");
this.firstSp.graphics.drawLine(0, 0, 100, 100, "#ffffff", 5);
this.firstSp.graphics.drawCircle(100, 100, 20, null, "ffffff");
Laya.stage.on(Laya.Event.MOUSE_WHEEL, this, this.MouseWheel); 
this._rootSp.hitArea = new Laya.Rectangle(0, 0, 10000, 10000)
this._rootSp.addChild(this.firstSp);
Laya.stage.addChild(this._rootSp);

private MouseWheel(e: Laya.Event) {
let xs = this.firstSp.scaleX;
if (e.delta > 0) {
xs = xs * 1.2;
}
else {
xs /= 1.2;
}
this.firstSp.scale(xs, xs);
}
}
new GameMain();
已邀请:

青刀快马

赞同来自: 180*****391

使用 canvas 模式。 初始化时不要使用 webgl, 这样就行了 
Laya.init(Browser.width, Browser.height);

该问题目前已经被锁定, 无法添加新回复

商务合作
商务合作