erikwatson / Bramble

A little JS game engine for jamming on prototypes.
MIT License
0 stars 1 forks source link

Bitmap Fonts #10

Open erikwatson opened 5 years ago

erikwatson commented 5 years ago

It would be good to support Bitmap Fonts. I think they're basically just letters and numbers in a sprite sheet, so we should be able to make good use of the existing and future spritesheet code when rendering them.

I don't know if there is a standard format for the fonts "texture atlas", so I will have to look that up and decide what to support at some point.

erikwatson commented 5 years ago

Seems like rendering text into the Canvas using strokeText and fillText is pretty slow. MDN recommends to avoid doing it unnecessarily - which to me means any time except when prototyping.

I am still going to include the standard drawing functions for this - it's useful to be able to draw quick and dirty text sometimes.