Skip to content

Latest commit

 

History

History
142 lines (90 loc) · 1.72 KB

label.md

File metadata and controls

142 lines (90 loc) · 1.72 KB

Label

Overview

Labels show text but can also be pressed.

<label text="press me!" ontap="foobar" />
actions.foobar = function ()
    print("you pressed a label!");
end

Properties

id

Set the ID for this control so that it can be updated later. See layout library.

<label id="my_lbl" text="foo" />

visibility

Set the visibility state using visible or invisible or gone.

<label visibility="gone" />

text

Set the text to be shown.

<label text="hello world" />

textalign

Set horizontal text alignment using left or center or right.

<label text="foo" textalign="right" />

Styling

See the styling page for more details.

Events

ontap

Occurs when the control is tapped.

<label text="foo" ontap="foo_tapped" />
actions.foo_tapped = function ()
    ...
end

onhold

Occurs when the control is held down.

<label text="bar" onhold="bar_held" />
actions.bar_held = function ()
    ...
end

ondown

Occurs when the control is released.

<label text="hello" ondown="hello_down" />
actions.hello_down = function ()
    ...
end

onup

Occurs when the control pressed down.

<label text="world" onup="world_up" />
actions.world_up = function ()
    ...
end