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

gaccob picture gaccob  路  3Comments

readygosports picture readygosports  路  3Comments

madroneropaulo picture madroneropaulo  路  3Comments

distinctdan picture distinctdan  路  3Comments

zcr1 picture zcr1  路  3Comments