开发者

Modify vectors at runtime

Is there any way to modify the vectors of a DisplayObject at runtim开发者_开发百科e? I import a Sprite or MovieClip on my application, and I want to be able to modify the vectors that composes it. A close approach is to use Graphic class, but it always renders below the Sprite, it can't clear the original graphic, and it can't modify the vectors, only draw new things.

And if this is totally impossible, I would like to know how I can call Sprite.graphics.drawXXX, so that the graphics are rendered above the Sprite.

Thanks.


Neither is possible. The graphics layer is always rendered beneath other objects in the Sprite's display list, and you can never change graphics once they have been drawn.

The only thing you can do about the latter is to create your own extension to the drawing mechanism, and manage all the vector information yourself. Then you can clear and re-draw the graphics every time values are changed.

To render graphics above other content, just create a new child Shape, draw inside of its graphics element, and then add it to the parent Sprite.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜