How to set a label as a value?

I want to make it so a label simply displays a value, how would I do this?

Do you mean: label.set_text("#label", "Hello World!") (use https://www.defold.com/manuals/introduction/)

(When you want to combine text and numbers, use ”..” and not + like in other programming languages)

3 Likes

Like this?

local value = 123
label.set_text("#mylabel", tostring(value))

EDIT: @Vincent was faster!

Not by much, just a few seconds :grin:

2 Likes