dbeef / spelunky-psp

Spelunky remake for Sony PSP.
Other
138 stars 10 forks source link

Text component #60

Closed dbeef closed 4 years ago

dbeef commented 4 years ago

I was unhappy with the previous API for font rendering (TextBuffer class), which was C-style and verbose in usage.

This MR introduces TextComponent, as in the component pattern, that will be included into each GameEntity that wishes to render text. It is RAII (no special action required to create or dispose it) - will render text as soon as set_text is called with any non-empty string, and will cease to render as soon as its destructor is called.

Former TextBuffer is to be removed.

Relates to: https://github.com/dbeef/spelunky-psp/pull/59