FreeFormLabel

From Crumbled World Wiki

FreeFormLabelExampleCode

Inheritance

Panel

Constructor

function description
Label(PanelSizeType sizeType, Vec2 position, string text, float textHeight)
Label(PanelSizeType sizeType, Vec2 position, string text, float textHeight, Vec3 textColor)
Label(PanelSizeType sizeType, Vec2 position, string text, float textHeight, Vec4 textColor)
Label(PanelSizeType sizeType, Vec2 position, string text, float textHeight, Vec3 textColor, Alignment textAlignment)
Label(PanelSizeType sizeType, Vec2 position, string text, float textHeight, Vec4 textColor, Alignment textAlignment)

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.