Class TextButton
A button that has a text label.
Usage:
-- Create a text button with the text "Hello"
local button = TextButton(0, 0, 100, 16, "Hello")
Fields
-
TextButton.text
-
The text of the button.
-
TextButton.textPadding
-
The padding between the text and the button edge.
Constructor
-
TextButton:_init (x, y, width, height, text, fontColor)
-
Constructs a button with a text label.
Parameters:
- x
The x coordinate of the new component, relative to its parent.
- y
The y coordinate of the new component, relative to its parent.
- width
The width of the new component.
- height
The height of the new component.
- text
The text string to display on the button. The button's size will
be based on this string.
- fontColor
(optional) The color of the text to display, default white.
Methods
-
TextButton:onClick (button)
-
Called when this button is clicked.
Parameters:
- button
The mouse button that was used.