-
Notifications
You must be signed in to change notification settings - Fork 0
net.rtml
Peter edited this page Aug 23, 2024
·
2 revisions
_g.net.rtml
Important
The net.rtml
module must be loaded with pos.require('net.rtml')
before it can be used from the global table
Unlike normal libraries it IS injected into the global table and a local reference is not required
Signature | Return | Description |
---|---|---|
createElement(type, x, y) |
RTMLElement |
Create a new typed RTMLElement |
createText(x, y, text, color?) |
RTMLElement |
Create a new text element |
createLink(x, y, text, href) |
RTMLElement |
Create a new link element |
createInput(x, y, length, name, hide?) |
RTMLElement |
Create a new input element |
createButton(x, y, tex, action) |
RTMLElement |
Create a new button element |
createSubmitButton(x, y, text) |
RTMLElement |
Create a new submit button element |
createContext() |
RTMLContext |
Create a new RTML context |
Variable | Value | Description |
---|---|---|
TYPE_TEXT: string |
"TEXT" |
Element type code for a text element |
TYPE_INPUT: string |
"INPUT" |
Element type code for a text input element |
TYPE_LINK: string |
"LINK" |
Element type code for a link element |
TYPE_DOMAIN_LINK: string |
"DOM-LINK" |
Element type code for a domain link element |
TYPE_BUTTON: string |
"BUTTON" |
Element type code for a button element |
BUTTON_ACTION_SUBMIT: |
"SUBMIT" |
Button action code for form submission |
BUTTON_ACTION_PUSH: |
"PUSH" |
Button action code for button ID push |
net.rtml.createElement(type: string, x: number, y: number): RTMLElement
Create a new typed RTMLElement
-
type: string
- Element type (one ofnet.rtml.TYPE_*
) -
x: number
- X position of the element -
y: number
- Y position of the element
-
element: RTMLElement
- The created element
net.rtml.createText(x: number, y: number, text: string, color: nil|color|string): RTMLElement
Create 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
-
element: RTMLElement
- The created element
net.rtml.createLink(x: number, y: number, text: string, href: string): RTMLElement
Create 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"
)
-
element: RTMLElement
- The created element
net.rtml.createInput(x: number, y: number, length: number, name: string, hide: boolean?): RTMLElement
Create 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
-
element: RTMLElement
- The created element
net.rtml.createButton(x: number, y: number, text: string, action: "SUBMIT"|"PUSH"): RTMLElement
Create 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_*
)
-
element: RTMLElement
- The created element
net.rtml.createSubmitButton(x: number, y: number, text: string, action: "SUBMIT"|"PUSH"): RTMLElement
Create a new submit button element.
Equivalent to setting action
to "SUBMIT"
for createButton()
-
x: number
- X position of the element -
y: number
- Y position of the element -
text: string
- Button text
-
element: RTMLElement
- The created element
net.rtml.createContext(): RTMLContext
Create a new RTML context (somewhat equivalent to a window) for simple construction of RTML.
-
context: RTMLContext
- The created context
RTML element
Field | Description |
---|---|
type: string |
Element type |
x: number |
X position of the element |
y: number |
Y position of the element |
color: nil|color|string |
Element foreground color |
bgColor: nil|color|string |
Element background color |
id: string? |
Element ID |
text: string? |
Element text |
name: string? |
(Form Element Only) Element name |
href: string? |
(Link Element Only) Link url |
len: number? |
(Input Only) Length of element |
hide: boolean? |
(Input Only) If input text should be hidden |
next: string? |
(Input Only) Next input to focus by form element name |
action: nil|"SUBMIT"|"PUSH" |
(Button Only) Button action |