EngoEngine / engo

Engo is an open-source 2D game engine written in Go.
https://engoengine.github.io
MIT License
1.74k stars 136 forks source link

Get Font Via URL #748

Closed Noofbiz closed 2 years ago

Noofbiz commented 3 years ago

Similar to all the other stuff in common, like common.GetLoadedSprite(url), but for fonts. This is so you can setup the font and call CreatePreloaded only one time, leading to only one font atlas. Then you can get it back using common.GetLoadedFont(url). This way systems only need the URLs rather than either playing with pointers to pass stuff around correctly, and calling CreatePreloaded more than once results in multiple font atlases being used.