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.
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:
Future work:
What about word wrapping?
Likely answer: allow an optional “max width” and wrap appropriately
@darzuhere is that word wrapping code I mentioned the other day. Looking at it now, it’s not complicated at all but at least I figured out the text ranges for punctuation!
Yes, the “set textSprite text (”")" block can be called as frequently as you like, perhaps in a “on game update” block if you want to report a frequently changing timer or score
Also, I updated the links in this forum post with new links now that the extension is officially being release and maintained by MakeCode. Going forward updates to the extension will happen to the microsoft/arcade-text repo not the darzu/arcade-text one.
I have no clue on what’s going on but the extension seems to be gone from the extensions tab. I know that it was there a month or two before so did anything happen to it?