flexwheel
flexwheel

Reputation: 1

UIComponent's width and height have no effect on Sprite

Given this code:

var circle:Sprite = new Sprite();

circle.graphics.beginFill(0xFFCC00);
circle.graphics.drawCircle(0, 0, 20);

var uiComp:UIComponent = new UIComponent();

uiComp.x = 100;
uiComp.y = 100;

uiComp.measuredHeight = 0;
uiComp.measuredWidth = 0;

uiComp.addChild(circle);

addChild(uiComp);

Why does changing the width and height of uiComp not affect the Sprite? Wouldn't UIComponent provide Sprite with a Graphics object, which limits that area where Sprite can draw?

Upvotes: 0

Views: 525

Answers (1)

Amarghosh
Amarghosh

Reputation: 59451

As I said in the other thread, use unscaledWidth and unscaledHeight as the bounds for drawing.

Upvotes: 1

Related Questions