Font - LiruJ/GuiCookie GitHub Wiki

Overview

A Font attribute, not to be confused with a font resource node determines how an element's text is drawn.

XML Attributes

Font

<Font Font="ButtonFont"/>

Specifies the font to be used. Note that this is not a path, but instead refers to a font defined in the Resources node.

Colour

<Font Colour="#ccffcc"/>

The colour applied to the text.

See Colour.

Tint

<Font Tint="#aaa"/>

The colour multiplied with the main colour to produce a final colour. This can be used to darken or lighten the main colour of a style, for instance when a button is hovered over or clicked.

TextAnchor

<Font TextAnchor="50%, 25%"/>

The relative position of the text element's parent that is treated as the origin. For example; 50%, 50% will mean that the text is drawn starting from the centre of the parent element.

This defaults to 50%, 50%.

See Space.

TextPivot

<Font TextPivot="50%, 0%"/>

The relative position of the text that is treated as the origin. For example; 50%, 0% will mean that the bottom centre of the text is drawn at the origin of the text element's parent.

This defaults to 50%, 50%.

DropShadowOffset, DropShadowColour

<Font DropShadowOffset="5, 5" DropShadowColour="Black"/>

Defines a drop shadow with an offset from the text's position and a colour.

See Vector2.

Offset

<Font Offset="0, 12.5"/>

Defines a final offset to be applied to the text's position when drawn. This can be used to "push down" text on a button when it is clicked, for example.

⚠️ **GitHub.com Fallback** ⚠️