gamnit :: TextSprites :: text=
app.ui_sprites
Does not redraw if text
has not changed.
# Update the text displayed by inserting new sprites into `app.ui_sprites`
#
# Does not redraw if `text` has not changed.
fun text=(text: nullable Text)
is autoinit do
# Don't redraw if text hasn't changed
if text == cached_text then return
cached_text = text
if not init_complete then return
# Clean up last used sprites
for s in sprites do if target_sprite_set.has(s) then target_sprite_set.remove s
sprites.clear
if text == null then return
font.write_into(self, text)
# Register sprites to be drawn by `app.ui_camera`
target_sprite_set.add_all sprites
end
lib/gamnit/font.nit:68,2--89,4