源代码如下:
class PositionStudy extends egret.DisplayObjectContainer{
public constructor()
{
super();
this.contain();
}
private contain()
{
varcontainer:egret.DisplayObjectContainer=new egret.DisplayObjectContainer();
container.x=300;
container.y=300;
this.addChild(container);
var shape:egret.Shape=new egret.Shape();
shape.graphics.beginFill(0xff0000);
shape.graphics.drawEllipse(0,0,100,80);
shape.graphics.endFill();
shape.height=200; //图像没有变大
shape.width=160;
shape.rotation=45;
container.addChild(shape);
}
}
shape.height=200; shape.width=150;这两个语句没有实现椭圆高为200,宽为160的效果,可以通 过 shape.scaleX=2; shape.scaleY=2;实现物体的缩放。