Pixi.js: issue, Pixi don't use true Alignment !? in Align only container ??

Created on 8 May 2017  路  2Comments  路  Source: pixijs/pixi.js

Hi guys and girls thank for help me about this issue.
I have some bug with the Align of pixi.text
Normally the alignment is supposed to work this way
afvafgvawe

But it is impossible for me to make text center (String) or right Justify, Same line in photoshop or Word.
I noticed that no demo or sample seems to show this possibility.
Is there a specific technique to use a true alignment? (text Justify)

for now .setPixiTextStyle( {align: 'center'} )
Not center the container but not the string ??
thank for help about this issue

馃 Question

Most helpful comment

text.style.align = 'left' / 'center' / 'right' only really effects multiline text. This is due to the way we draw text onto a canvas, and use that canvas as a texture to draw from.

What you can do is use text.anchor.x = 0 to left align, text.anchor.x = 0.5 to center align, and text.anchor.x = 1 to right align

All 2 comments

text.style.align = 'left' / 'center' / 'right' only really effects multiline text. This is due to the way we draw text onto a canvas, and use that canvas as a texture to draw from.

What you can do is use text.anchor.x = 0 to left align, text.anchor.x = 0.5 to center align, and text.anchor.x = 1 to right align

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

neciszhang picture neciszhang  路  3Comments

Darker picture Darker  路  3Comments

YuryKuvetski picture YuryKuvetski  路  3Comments

softshape picture softshape  路  3Comments

madroneropaulo picture madroneropaulo  路  3Comments