Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

Text2D x change not displayed on screen

$
0
0

I tried to create a text centering solution.

 

I create a Group2D container for a Text2D - textFieldContainer.

Inside the container I create a Text2D (naturally) - textField.

Whenever I change the text, I set textField.x to be textField.width / 2 (textField.width returns different values for different widths as expected).

By doing that I'm attempting to keep the actual text centered to the (0, 0) of the textFieldContainer. (and so I'm able to play freely with textFieldContainer's x and y without affecting textField.x centering solution.

 

The problem is the text isn't actually being moved on screen.

 

I created a PG reproducing this problem:

http://www.babylonjs-playground.com/#1088V8#1

Line 24 has no effect at all, commenting it results in the same display.

I created the marker textField to help you see better that the text is not moved.

 

It's as if there's an extra placement logic for Text2D behind the curtains that's preventing me for moving it around properly.

I also tried playing with textField.origin, to no avail.

 

I attached an image demonstrating how it is now (X), and how it should look centered (V).

 

ss.png

 

@Nockawa


Viewing all articles
Browse latest Browse all 760

Trending Articles