draw circle in a new layer actionscript?
i do not want to draw a circle on the same layer the background is. So how can i sepa开发者_运维问答rate background layer and drawing layer?
using graphics.drawCircle to draw circle
- Create two Sprites or MovieClips within your MovieClip.
- Apply beginFill, drawCircle, endFill to them.
- addChild to them relative to their layer
For example :
var player:Sprite = new Sprite()
player.graphics.beginFill(0x111111);
player.graphics.drawCircle(0, 0, 20);
player.graphics.endFill();
var background:Sprite = new Sprite()
background.graphics.beginFill(0x111111);
background.graphics.drawCircle(0, 0, 50);
background.graphics.endFill();
addChild(background);
addChild(player);
精彩评论