开发者

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


  1. Create two Sprites or MovieClips within your MovieClip.
  2. Apply beginFill, drawCircle, endFill to them.
  3. 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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜