I’m working on an extension that makes it easier to have text in your game. The big motivations for me are for creating custom UI and HUD elements as well as signage in games. Using this extension, you can basically duplicate the built-in life, score and countdown elements.
These are the blocks:
and the expandable blocks expanded:
This extension handles unicode. If non-ascii characters are entered, a unicode font will be used.
A maximum height for the text can be specified. Since our fonts in Arcade are limited, this will always be rounded down to a multiple of 5, 8, or 12. We try to use the most appropriate font for your size and whether or not unicode is present.
And of course since these are sprites all the other sprite functions work with these.
Here’s the extension:
Here’s a sample:
- What about word wrapping?
- Likely answer: allow an optional “max width” and wrap appropriately