开发者

Where in the framework is the Graphics object passed around to achieve drawing?

开发者 https://www.devze.com 2022-12-09 00:58 出处:网络
I\'m trying to understand how the Flex framework draws objects (Button, Label, Image, etc.). The Button class seems to draw itself by addChild()ing its ProgrammaticSkin. However, where in the framewor

I'm trying to understand how the Flex framework draws objects (Button, Label, Image, etc.). The Button class seems to draw itself by addChild()ing its ProgrammaticSkin. However, where in the framework is the Graphics object being passed around in the hierarc开发者_如何学Chy to achieve the drawing. I want to get to the level of 2D API.


There is no single global graphics object in flash/flex. Every Shape and Sprite (UIComponent is a Sprite) has a graphics object of type Graphics that can be drawn on. In a flex app, programmatic drawing should be done in the overriden updateDisplayList method of the component. You should use the component's unscaledWidth and unscaledHeight as its bounds while drawing on it.

0

精彩评论

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