Label

From Crumbled World Wiki

LabelExampleCode

Inheritance

Panel

Constructor

function description
Label(PanelSize size, string text)
Label(PanelSize size, string text, Vec3 textColor)
Label(PanelSize size, string text, Vec4 textColor)
Label(PanelSize size, string text, Alignment align)
Label(PanelSize size, string text, Vec3 textColor, Alignment align)
Label(PanelSize size, string text, Vec4 textColor, Alignment align)
Label(PanelSize size, Text text)
Label(PanelSize size, Text text, Vec3 textColor)
Label(PanelSize size, Text text, Vec4 textColor)
Label(PanelSize size, Text text, Vec4 textColor Alignment align)
Label(PanelSize size, Text text, Vec3 textColor Alignment align)

Functions

return function description
Text getText() Get text.
Vec4 getTextColor() Get text.
float getTextHeight() Get text.
Alignment getAlignment() Get text.
Vec2 getTextSizeInPixel() Get the recomended size based on current text and text height.

Return the size in pixel.

setText(string text) Set text.
setText(Text text) Set text.
setTextHeight(float height) Set text height. if value larger larger then 1.0 height represent height in pixel, bellow 1.0 height represent percent of screen height.

Example 0.1 is 10% of screen resolution and 10 means the text is 10px high.

setTextAlignment(Alignment align) Set alignment.
setTextColor(Vec3 color) Set text color.
setTextColor(Vec4 color) Set text color.
setPanelSizeBasedOnTextSize() PanelSize will be based on the text.
setParseTags(bool parseTags) Set text color.