Skip to main content
Inspiring
December 30, 2016
Answered

How to get border for createjs.DOMElement ?

  • December 30, 2016
  • 1 reply
  • 664 views

I created a multiple text with style justify and have to use createjs .DOMElement for this style, because property a textAlign  doesn' t include   a style justify for createjs.Text.

How I get width/height for multiple text?

work

var txt = new createjs.Text("", "18px Courier", "111");

stage.addChild(txt);

var bounds = txt.getBounds();

doesn't work

var e = document.createElement("div");

e.style = .....

document.body.appendChild(e);

var content = new createjs.DOMElement(e); 

stage.addChild(content);

var bounds = content .getBounds();  // here bounds  == null

This topic has been closed for replies.
Correct answer ClayUUID

getBounds() is a CreateJS canvas function, so of course it doesn't work with DOM elements.

html - Understanding offsetWidth, clientWidth, scrollWidth and -Height, respectively - Stack Overflow

1 reply

ClayUUIDCorrect answer
Legend
December 30, 2016

getBounds() is a CreateJS canvas function, so of course it doesn't work with DOM elements.

html - Understanding offsetWidth, clientWidth, scrollWidth and -Height, respectively - Stack Overflow