开发者

draw circle in a new layer actionscript?

开发者 https://www.devze.com 2023-02-20 17:58 出处:网络
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?

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

精彩评论

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