Multi-Resolution Game Development With GameBuilder Studio Check it out!
NEW Version 0.9.7 has arrived! New Blazing Fast Particle Engine & More Game Actions. Check it out
How to Align Text in the Text renderer ?
  • In my game i am displaying random numbers 1 , 2 , 3 , 23 , 34 etc. I would like to align to center regardless of values . I am using 0.9.9 pro version i dont see any text align property . Is there any other way to align text . I tried using registrationpoint.x/ 2  but still it aligns to left . 
  • 2 Comments sorted by
  • @Maheswari, no there is no align text setting currently. You will need to manually center the text based on its size and point you want it to be centered on. If you want to center it within 150 and 200 pixels from the left edge then you can position it with an expression like this:

    x = 175 - (TextRenderer.size.x / 2)

    175 being the center point between 150 and 200. This of course is assuming that the image registration point is top left (0x0) of text renderer. As long as your Text Renderer is set to autoScale then the renderer size property should be updated as the value changes.
  • @Lavon

        Thanks. I tried to add space before value.... when its lower than 10. Since number is not going to exceed 2 digits it works for me....  

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion