Closed photonstorm closed 10 months ago
Ah, yes, that would be pretty cool! I'll think about adding something like that.
Added!
You can now load a custom font with qxa.loadFont(), then use it with qx.setFont(). Also added an example showing how to use it, see example-fonts.html.
Thanks for the feature request!
This is great fun :) I had a blast creating a little starfield effect and a small game.
I think it would be a really nice idea to allow users to create custom characters. This is very in keeping with retro systems, where you could often redefine the pixels of character sets.
Rather than go to that extreme, I think it'd be great to be able to pass an array of 0/1 values to a function that created a new character that could be used with
qx.spr
orqx.printChar
. Or, I guess when you load thechr.png
, you render it to a canvas - then a function could overwrite any character in that canvas with your own based on the pixel data you pass.I guess you'd have to run
regenColors()
each time they did this, so it would need some additional code to handle thetempCanvas
andthis.chrImages_
that textrenderer creates, or it would just keep creating them for every custom character. Even so, it would allow for custom sprites without the need to edit the png, which I think makes sharing games much more accessible :)Anyway, just a suggestion!