How do I label a sprite

0 favourites
  • 2 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • I have dynamically created sprites and I am using text objects to give them a label (ie one or two character numbers, such as 5 or 27). The problem is the text object needs to position to a different image point based on the size of the number in the text.

    Or is there an easier way to label an image?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi,

    Maybe your text box is left aligned? If your text box is centered then it should appear always correctly if there is 1 digit or 2 digits.

    Another possible solution you could use, since I don't know the specifics of your project, is to clone your sprite and have one sprite for digits 1 to 9 and a cloned sprite for digits 10 to 99.

    And yet another possible solution is to, instead of spawning the text on the sprite, is to spawn the sprite behind the text which is correctly positioned.

    Good luck

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)