Difference between revisions of "Text"

From Castle Wiki
(Created page with "'''Text''' is a behavior that causes actors to display text. Actors displaying text are sometimes referred to as '''Text Actors'''. All text actors have a '''co...")
 
m (Fix text box response name)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Text''' is a [[behavior]] that causes [[Actor|actors]] to display text. Actors displaying text are sometimes referred to as '''Text Actors'''.
'''Text''' is a [[behavior]] that causes [[Actor|actors]] to display text. Actors displaying text are sometimes referred to as '''Text Actors'''.
 
[[File:Text-actor.jpg|alt=A screenshot of the inspector editing a Text actor with a red font showing the word "tomato"|thumb|[[Inspector|Inspecting]] a text actor showing the word "Tomato"]]
All text actors have a '''content''' property indicating the text they'll display, such as "Welcome to my game". They also have a size, font, text alignment, and color. Text actors do not use [[Art]], but they have a physical body, allowing them to [[Motion|move]] and [[Collision|collide]].
All text actors have a '''content''' property indicating the text they'll display, such as "Welcome to my game". They also have a size, font, text alignment, and color. Text actors do not use [[Art]], but they have a physical body, allowing them to [[Motion|move]] and [[Collision|collide]].


Line 8: Line 8:
== Displaying the value of [[Variable|variables]] ==
== Displaying the value of [[Variable|variables]] ==
Inside any Text, you can write the variable name (including the $) to display the value of the variable when the deck is played. For example: "Your score is $score".
Inside any Text, you can write the variable name (including the $) to display the value of the variable when the deck is played. For example: "Your score is $score".
== Text boxes ==
[[File:Text-boxes.jpg|alt=A screenshot of the topdown golf kit showing two text boxes: "The ball fell into the water!" and "OK"|thumb|A screenshot of a golf game showing two text boxes. One of them can be tapped to restart the game.]]
'''Text boxes''' are a special kind of text that can only be added during gameplay using the '''Create a text box''' [[Response]]. Unlike text actors, they can only have one specific font and color, and they cannot collide or use physics. They can optionally run a [[Rule]] when tapped. They can be useful to provide instructions, dialogue, alerts, buttons, or other interface text that doesn't need to be part of [[card]] space.

Latest revision as of 18:06, 17 May 2022

Text is a behavior that causes actors to display text. Actors displaying text are sometimes referred to as Text Actors.

A screenshot of the inspector editing a Text actor with a red font showing the word "tomato"
Inspecting a text actor showing the word "Tomato"

All text actors have a content property indicating the text they'll display, such as "Welcome to my game". They also have a size, font, text alignment, and color. Text actors do not use Art, but they have a physical body, allowing them to move and collide.

Adding text

To add text to a card, go to the Belt and press the + button to add a new Blueprint. In the sheet that appears, choose Text.

Displaying the value of variables

Inside any Text, you can write the variable name (including the $) to display the value of the variable when the deck is played. For example: "Your score is $score".

Text boxes

A screenshot of the topdown golf kit showing two text boxes: "The ball fell into the water!" and "OK"
A screenshot of a golf game showing two text boxes. One of them can be tapped to restart the game.

Text boxes are a special kind of text that can only be added during gameplay using the Create a text box Response. Unlike text actors, they can only have one specific font and color, and they cannot collide or use physics. They can optionally run a Rule when tapped. They can be useful to provide instructions, dialogue, alerts, buttons, or other interface text that doesn't need to be part of card space.