-
Notifications
You must be signed in to change notification settings - Fork 0
net.rtml.RTMLContext
Peter edited this page Aug 21, 2024
·
1 revision
Part of net.rtml
RTML context builder
Instantiate a new RTML context builder
Variable | Description |
---|---|
elements: RTMLElement[] |
Context elements |
Signature | Return | Description |
---|---|---|
addElement(element) |
nil |
Add an RTMLElement to the context |
addText(x, y, text, color?) |
nil |
Add a new text element |
addLink(x, y, text, href) |
nil |
Add a new link element |
addInput(x, y, length, name, hide?) |
nil |
Add a new input element |
addButton(x, y, text, action) |
nil |
Add a new button element |
addSubmitButton(x, y, text) |
nil |
Add a new submit button element |
RTMLContext:addElement(type: string, x: number, y: number): nil
Add an RTMLElement to the context
-
type: string
- Element type (one ofnet.rtml.TYPE_*
) -
x: number
- X position of the element -
y: number
- Y position of the element
RTMLContext:addText(x: number, y: number, text: string, color: nil|color|string): nil
Add a new text element
-
x: number
- X position of the element -
y: number
- Y position of the element -
text: string
- Element text -
color: nil|color|string
- (Optional) Text color
RTMLContext:addLink(x: number, y: number, text: string, href: string): nil
Add a new link element
-
x: number
- X position of the element -
y: number
- Y position of the element -
text: string
- Link text -
href: string
- Link destination, can be absolute ("/path"
), or relative ("path"
)
RTMLContext:addInput(x: number, y: number, length: number, name: string, hide: boolean?): nil
Add a new input element
-
x: number
- X position of the element -
y: number
- Y position of the element -
length: number
- Input length -
name: string
- Input name for forms -
hide: boolean?
- (Optional) If input text should be hidden
RTMLContext:addButton(x: number, y: number, text: string, action: "SUBMIT"|"PUSH"): nil
Add a new button element
-
x: number
- X position of the element -
y: number
- Y position of the element -
text: string
- Button text -
action: "SUBMIT"|"PUSH"
- Button action (one ofnet.rtml.BUTTON_ACTION_*
)
RTMLContext:addSubmitButton(x: number, y: number, text: string, action: "SUBMIT"|"PUSH"): nil
Add a new submit button element.
Equivalent to setting action
to "SUBMIT"
for addButton()
-
x: number
- X position of the element -
y: number
- Y position of the element -
text: string
- Button text