Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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.

like image 921
strah Avatar asked Apr 19 '12 10:04

strah


1 Answers

@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)

like image 143
Lanny Avatar answered Nov 15 '22 05:11

Lanny