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
text renderer always centering
  • Hi, curious if anyone has had better luck than I

    I already have a text renderer that keeps track of the ammo count the character's weapon has left, and this works fine. The challenge is the positioning.
    The goal is to have the text renderer that displays a number which is changing (number of ammo a weapon has) always having its' registration point centered based on if the text displaying is a single digit like (0, 1, 3, 4 etc) or and double digits (11, 12, 13. . .20's, 30's ... etc.)
    I noticed  we can't have 01, 02, 03 etc only 1, 2, 3 etc which is why I am trying to get the number to center every time it changes.

    So first I would set the position of the text render's Basic Spatial to a certain point on the screens X-axis.

    Then maybe somehow add another rules component to constrain the text renderers' registration point X  to  the Renderers' size X divided by 2.

    @Renderer.registrationPoint.x = expression   Self.Renderer.size.x /2

    This and many variations does not seem to have an effect on keeping the registration point centered, maybe I have to check for something else or update everytime the text renderer's text updated? 
  • 2 Comments sorted by
  • Nevermind. taking diff approach.
  • @BenFromOregon let me see if we can add alignment settings to the text renderers properties for this next build. v0.9.8 is about to be released.

Howdy, Stranger!

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

In this Discussion