Spritefont not displaying text

0 favourites
  • 5 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • In the above image you can see 2 different scenarios

    1. Typing name directly in the variable. Works and displays fine.

    2. Getting the name from Array. The correct text gets all the way to Spritefont object, but then the text just doesn't display in game.

    I managed to get some character names to show increasing the text area but not all. So my issue seems to be that the Spritefont object thinks there isn't enough space for the text, even though there clearly is because when I write it there normally it shows. Is this a bug or am I doing something wrong?

  • Just make it much larger, for the sake of testing. It's usually an issue with the size.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just make it much larger, for the sake of testing. It's usually an issue with the size.

    Tried that and found out Spritefont is displacing/changing the alignment of the text (which is why it got cropped out of the smaller box). Very weird...

  • You might have a line break in the text (at the beginning or at the end of the string. Line breaks are not shown in debug mode.

    Add trim() expression, it will remove all linebreaks, spaces, tabs etc.

    Set text to trim(tokenat(.....

  • You might have a line break in the text (at the beginning or at the end of the string. Line breaks are not shown in debug mode.

    Add trim() expression, it will remove all linebreaks, spaces, tabs etc.

    Set text to trim(tokenat(.....

    That was it, forgot to trim the original data. Thanks a lot! ??

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