how do i format variables and strings inside of a text box? :o
Viewing post in General Decker Question and Answer Thread
If by “format” you mean “putting strings together to make human-readable output”, you probably want the format operator as described in the Lil documentation. It looks something like this:
goods:"apples"
quantity:5
price:1.23
message:
"You have bought %i %s at $%0.2f each, for a total of $%0.2f" format
(quantity,goods,price,price*quantity)
# "You have bought 5 apples at $1.23 each, for a total of $6.15"
If you mean formatting like “bold and italic”, Decker doesn’t provide those automatically, but it does let you change the font and colour of text in a text box. The easiest way is probably with the rtext interface.
field1.text:rtext.cat[
rtext.make["Red text in the menu font" "menu" "" colors.red]
rtext.make["Blue text in the body font" "body" "" colors.blue]
rtext.make["Black text in the mono font" "mono" "" colors.black]
]
The result looks like this:
