Pixi.js: [confused] formula to make calculate the width of a text box

Created on 10 Dec 2016  ·  5Comments  ·  Source: pixijs/pixi.js

Hi all :) I am trying to calculate the width of a text box so I can animate a second text box next to the first one, leaving enough space for what ever content is put in the first. How should I go about doing this?

this is what I have so far but its not working. The text just disappears with no errors in the console:

text2.x = text1.textWidth + 500;

🤔 Question

Most helpful comment

text2.x = text1.width + 500;

All 5 comments

text2.x = text1.width + 500;

Thank you!

Is there a way to add this with y position in one line? Thanks!

text1b.position.set((text1a.width + 520), 0)

never mind :)

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

madroneropaulo picture madroneropaulo  ·  3Comments

softshape picture softshape  ·  3Comments

gigamesh picture gigamesh  ·  3Comments

samueller picture samueller  ·  3Comments

finscn picture finscn  ·  3Comments