How to find the width and height of a DisplayObject in EaselJS

strah picture strah · Apr 19, 2012 · Viewed 7.6k times · Source
var tf = new Text(letter, font, color);
var tfContainer = new Container();
tfContainer.addChild(tf);

How can I find out what are the dimensions of the 'tfContainer'?

I know I can use tf.getMeasuredWidth() and tf.getMeasuredLineHeight() but I'd rather use more general approach. Besides that doesn't return accurate measurements.

Answer

Lanny picture Lanny · Apr 23, 2012

@Akonsu is correct, there is no support for width and height, largely because calculating it is very expensive, especially in vectors and groups with transformations on children. We are considering it, but there is no concrete plans for it yet.

-Lanny (gskinner.com)