How do you put numbers in a sign or text?
I'm trying to create a sign that displays a number that can change over time. I want the number to come from a circuit input but I can't figure out how to include the number in the text such that I can change it dynamically.
Best Answer
To include numbers in the text, use one of these special character sequences to display values input on the corresponding pins.
{R}
to display the value input on the red pin.
{G}
to display the value input on the green pin.
{B}
to display the value input on the blue pin.
For example, if you want to display the amount of gold a player has on a sign, you might wire their player stat to the red pin of the sign and then put the following text.
You have {R} gold.
If the player then has 80 gold, the {R}
will be replaced leaving the sign text to read:
You have 80 gold.
This works with Signs, Text Gadgets, and for some pins on the Message chip.
Pictures about "How do you put numbers in a sign or text?"
How do you display numbers in a text?
Format numbers as textHow do you add a number to a text?
Superscript in WordConvert Text to Numbers or Numbers to Text
More answers regarding how do you put numbers in a sign or text?
Answer 2
You can also use {C}
, {M}
, {Y}
and {K}
to get inputs from the other pins, but their usefulness is mostly limited by their sideeffects.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Pixabay, Tim Douglas, Shamia Casiano, Karolina Grabowska