Skip to content

Latest commit

 

History

History
159 lines (100 loc) · 1.99 KB

label.md

File metadata and controls

159 lines (100 loc) · 1.99 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" />

icon

Set a standard control icon. See icons list of available icons.

<button icon="select" />

image

Set a custom image to use. Should be an absolute path or relative to the layout file.

<button image="img.png" />

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