Show numbers

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Serenade
:warning: Old Version Published before Godot 3 was released.

How can i draw numbers on screen when i, for example, shoot bullets…
I have a bullet counter that i can keep track only in print() …
How can i make that counter to appear and update on screen, like, in a corner of the window

:bust_in_silhouette: Reply From: Nutr1z


It’s simple, you must use a Label node, place it on a corner of the screen, then :

var count = 42
get_node("Label").set_text(str(count ))

for taking change if frame you must call this in func _process(delta):, see Processing doc

You can use draw_string too, look at “Custom Drawing in 2D” on the docs and the draw functions of CanvasItem

eons | 2017-01-20 14:43