TextBox Template - LiruJ/GuiCookie GitHub Wiki
The TextBox and TextLabel templates are used to display text in a non-interactable way. This can be used for anything from the main title of the game, menu labels, and debug menus.
<TextBox Components="Frame, TextBlock" Controller="TextBox"/>
<TextLabel Components="TextBlock" Controller="TextBox"/>Both templates use the TextBox controller and define a TextBlock component.
The TextBox template defines a background Frame, whereas the TextLabel template does not. This makes the TextBox template better suited to situations in which the text calls for extra attention, like the header of a menu, whereas the TextLabel is better suited for the content of a menu.
<TextBox Size="128, 32" Text="This is a text box"/>Just setting a size and starting text is enough for a TextBox. The text will automatically be centred within the frame.
<TextLabel Size="128, 32" Text="This is a label"/>Just setting a size and starting text is enough for a TextLabel. The text will automatically be centred within the element.
Note that the centring of the text can be changed via the attributes of the TextBlock.
Also note that by default, text overlaps the element. This is due to the limitations of MonoGame's SpriteFont drawing systems, and plans exist to add word wrapping and clipping into a future version of GuiCookie.