Direct access to Sprite's graphics
I"m new to AS3 and I would like to know how can I get to graphics of a Sprite so开发者_运维知识库 I could draw it directly from it. I mean I don"t want to use Sprite class as my concrete objects I just want Sprite to hold graphics so if my own object needs to be drawn it asks for graphics to SpriteManager which returns Sprite with required graphics and draws it exactly where I want to not where Sprite's coordinates points to.
Thank you for answer.
I'm not sure I get what you want to do, but you can use a Shape object and draw on it like this
var s:Shape = new Shape();
s.graphics.beginFill( 0 );
s.graphics.drawCircle( 10, 10, 10 );
s.graphics.endFill();
It's just a basic object that acts as a drawing layer.
精彩评论