我生成精灵编程方式是这样的:设置锚点中间
this.food = new Sprite();
this.food.graphics.beginFill(0xFFFFFF);
this.food.graphics.drawRect(0, 0, 10, 10);
this.food.filters = [new GlowFilter(0xFF6699, .80, 5, 5, 2, 2, false, false)];
this.food.graphics.endFill();
this.food.x = this.x;
this.food.y = this.y;
this.stage.addChild(this.food);
,后来我这样做:
public function update():void
{
// Spin the food
this.food.rotation += 1;
}
我基本上要的食物精灵慢慢旋转关于它的中心,而不是它的x和y值,它是精灵的左上角。
如何让锚点成为精灵的中心?