crystal.Text

A UI element which draws text.

Constructor

crystal.Text:new(initial_text)

If ommitted, the initial_text to display defaults to "". The default alignment is "left", and the default font is "crystal_bold_md" (Source Code Pro Bold at size 16).

Methods

Name Description
font Returns the name of the font used to draw text.
set_font Sets the font used to draw text.
set_text_alignment Sets how text is aligned within this element.
set_text Sets the text to display.
text_alignment Returns how text is aligned within this element.
text Returns the text to display.

Examples

local text = crystal.Text:new("Hello World");
text:set_alignment("center");

This site uses Just the Docs, a documentation theme for Jekyll.