how add text to small scenes

jackhenjackhen Posts: 23Member
edited July 22 in GUI

I use pixel art in my game and I have many places where I want to add text to an object that uses a small pixel art sprite. However, The text is very blurry and impossible to see when it is the size that I want it. in this example I have a node that I plan on adding to a game character to display its stats like in hearthstone. What are my options for creating this object with text that fits inside the yellow/ red spaces and is not blurry? I plan on this scene to take up a very small portion of the screen with the text being around size 12-18 font when viewed while playing the game.

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 2,831Admin

    You’ll probably need to use a custom Dynamic or Bitmap font, where the font is a pixel art font designed to be used at such a small size. Kenney has some decent pixel art fonts. Make sure to disable font filtering though, as otherwise interpolation will be applied.

  • CalinouCalinou Posts: 451Admin Godot Developer
    edited July 22

    @TwistedTwigleg said:
    Make sure to disable font filtering though, as otherwise interpolation will be applied.

    Filtering is already disabled by default on DynamicFont. That said, you can disable antialiasing in DynamicFontData to get crisper pixel fonts. To do so, you'll need to edit the DynamicFontData (which is part of DynamicFont), uncheck Antialiased and save it as an external .tres resource. The last step is absolutely required. Otherwise, the value won't persist when the project starts.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file