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

var tf = new Text(letter, font, color);
var tfContainer = new Container();
tfContainer.addChild(tf);

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

I know that I can use tf.getMeasuredWidth () and tf.getMeasuredLineHeight (), but I would prefer to use a more general approach. In addition, it does not return accurate measurements.

+5
source share
3 answers

@Akonsu is true, there is no support for width and height, mainly because computing is very expensive, especially in vectors and groups with transformations on children. We are considering this, but there are no concrete plans for this yet.

Lanny (gskinner.com)

+5
source

there is no such function in easel.js. I read somewhere that they planned to add it, but I don’t know yet how much I know.

+1
source

, DisplayObject . calculateSize(), , , .

0

All Articles