deploy: 8b6eaccd18
This commit is contained in:
@@ -1,31 +1,43 @@
|
||||
# Label : VisualElement
|
||||
This is the label class. It provides a simple text display element that automatically
|
||||
resizes its width based on the text content.
|
||||
|
||||
## Properties
|
||||
|
||||
|Property|Type|Default|Description|
|
||||
|---|---|---|---|
|
||||
|text|string|Label|Label text to be displayed
|
||||
|text|string|Label|The text content to display. Can be a string or a function that returns a string
|
||||
|
||||
## Functions
|
||||
|
||||
|Method|Returns|Description|
|
||||
|---|---|---|
|
||||
|[Label.new](#Label.new)|Label|
|
||||
|[Label:init](#Label:init)|-|
|
||||
|[Label:render](#Label:render)|-|
|
||||
|[Label.new](#Label.new)|Label|Creates a new Label instance
|
||||
|[Label:init](#Label:init)|Label|Initializes the Label instance
|
||||
|[Label:render](#Label:render)|-|Renders the Label by drawing its text content
|
||||
|
||||
## Label.new()
|
||||
Creates a new Label instance
|
||||
|
||||
### Returns
|
||||
* `Label` `object` The newly created Label instance
|
||||
* `Label` `self` The newly created Label instance
|
||||
|
||||
### Usage
|
||||
```lua
|
||||
local element = Label.new("myId", basalt)
|
||||
local label = Label.new()
|
||||
```
|
||||
|
||||
## Label:init()
|
||||
## Label:init(props, basalt)
|
||||
Initializes the Label instance
|
||||
|
||||
### Parameters
|
||||
* `props` `table` The properties to initialize the element with
|
||||
* `basalt` `table` The basalt instance
|
||||
|
||||
### Returns
|
||||
* `Label` `self` The initialized instance
|
||||
|
||||
## Label:render()
|
||||
Renders the Label
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user