Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to get border for createjs.DOMElement ?

Explorer ,
Dec 29, 2016 Dec 29, 2016

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

625
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 30, 2016 Dec 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

Translate
LEGEND ,
Dec 30, 2016 Dec 30, 2016
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines