How to do GUI like text but expanding

  1. There’s a really nice demo for doing panning with a plane. https://www.babylonjs-playground.com/#DD2IDJ#45This actually is what makes up the panning code for the GUI editor as well. Also like this demo as well for the example you posted. https://playground.babylonjs.com/#5QBZT0#9 :slight_smile:

  2. I’m not sure I understand what you mean with the ellipse. If you would like text to clip with an ellipse shape container? Or is it just wrapping in general. Most common what I think you want is

label.textWrapping = true;

or resizeToFit = true. Some helpful hints for both. textwrapping will wrap the text to a given container size. Aka the size of the textBlock itself. resizeToFit will resize the text container w/h to fit the text.

3.To do this you will want to use the radius of the camera and come up with an offset formula. You can calculate this every frame for example: https://playground.babylonjs.com/#XCPP9Y#9102
In this I just played with the numbers. You want formula that will become a smaller offset as the radius becomes higher.

1 Like