So, you want to show text in your game?

5

Features on these Courses

Stats

4,375 visits, 5,807 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 4 Dec, 2019.

The humble word.

Take a minute and just think about some of the different ways a game might display words. Or numbers for that matter. Scores, inventories, instructions, dialogue… There are numerous ways that text can be utilised within a game. And handily, Construct has numerous ways you can handle text.

At its most basic level, displaying text is as simple as either creating a text (not to be confused with TextInput) or SpriteFont object and typing something in its Text property.

This is great if you just have something static you want to display. For example, in the intro to Kiwi Story, a SpriteFont object is used to show the player what to do.

The two objects are highly customisable in terms of how you want your text to look. The Text object allows you to either use built-in fonts (though remember these may not be common to all devices) or install Webfonts to bundle with your project. SpriteFont uses an image for your font, so you can draw the letters however you wish – then set the character properties accordingly. Both types of objects offer BBCode formatting, but as the SpriteFont object renders images for the text, the tags available differ to those for the Text object.

You can also change text and formatting in your game using the various actions associated with both objects – the manual will detail what all of these actions do.

So there you go, a good starting point for using text in a game is to simply try out the Text and SpriteFont objects. (You’ll need to be familiar with Text at least for the rest of this course!)

  • 1 Comments

  • Order by
Want to leave a comment? Login or Register an account!