Musings, ramblings, rantings about technology, games, puzzles, and whatever else catches my attention.
Sunday, October 20, 2013
Seriously.
At some point, any sufficiently advanced game toolkit will have some means for supporting text displays. It's amazing to me how much work it is to get a baseline of functionality, and it amazes me how many different times I've done it - not that I've often gone far beyond the minimal baseline.
In the screenshot above, you'll see title text, which is baked in to the yellow background image. Beneath that is an informational card, which is its own image, and created in a Python (PIL) script. The text on the right, demonstrating simple text rendering, including word wrap of long strings, that's actually done by my JavaScript code, using a "sprite sheet" that I generated with yet another Python (PIL) script.
I'm using Jaws.js, which has a "SpriteSheet" class, which seems to be designed for sprite animation frames, but can be pressed into service for character letterforms. It has options for the frames to go in a strip to the right, or in a strip going down, but there's no facility for a 2D grid of frames, which seems like it might be a good thing to have.
This isn't even what I'd call "finished", in that there's sloppy stuff in there that I want to clean up, but it's probably good enough to get this particular game working. Good enough to ship.
Which is to say that I'm not done writing character rendering code. [sigh]
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment