This is the documentation of MiniScript language within A-GUI. This document is WIP.
MiniScript was developed as part of our TDME2 3D Engine to match the requirements for high performance script execution, as well as straight forward game logic scripting.
MiniScript might borrow some ideas from JavaScript, Kotlin, PHP and even C++, which you might like and find familier. Also note the focus on easy integration into other products and easy customizability and extendability.
- MiniScript is open source
- please check the license
- you find the source code at https://github.com/andreasdr/miniscript
- here you find developer documentation including collaboration graphs and API
- Introduction to MiniScript language features:
- very small implementation of a scripting language
- runs on every CPU, OS, ... due to its simplicity, so its highly portable
- can be easily extended by writing state machine machine states and script methods in C++ as well as custom data types
- built-in data types: null, boolean, integer, float, string, byte array, array, map, set, vector2, vector3, vector4, quaternion, matrix3x3, matrix4x4, transform, ...
- when calling script C++ methods or script functions with arguments it does optionally use references or value by copy
- supports functions and recursion
- supports inline/lamda functions
- supports operators by operator to method mapping by a preprocessor run
- supports loops and conditions
- supports programming with classes style programming
- for built-in datatypes: string, byte array, array, map, set, vector2, vector3, vector4, quaternion, matrix3x3, matrix4x4, transform, ...
- for script classes/objects
- for custom data types
- supports event like programming
- unicode support via UTF8
- can be transpiled to C++
The boilerplate template code for a MiniScript GUI logic looks like: gui_script_template.tscript
Table of methods |
---|
Returns if GUI element node has a specific condition enabled |
gui.elementnode.conditions.has($elementNodeId: String, $condition: String): Boolean |
Get enabled GUI element node conditions |
gui.elementnode.conditions.get($elementNodeId: String): Array |
Set enabled GUI element node condition |
gui.elementnode.conditions.set($elementNodeId: String, $condition: String): Null |
Set array of enabled GUI element node conditions |
gui.elementnode.conditions.setAll($elementNodeId: String, $conditions: Array): Null |
Add enabled GUI element node condition |
gui.elementnode.conditions.add($elementNodeId: String, $condition: String): Null |
Remove enabled GUI element node condition |
gui.elementnode.conditions.remove($elementNodeId: String, $condition: String): Null |
Remove all enabled GUI element node conditions |
gui.elementnode.conditions.removeAll($elementNodeId: String): Null |
Table of methods |
---|
Returns GUI event performed action type integer code |
gui.event.ACTIONTYPE_PERFORMED(): Integer |
Returns GUI event performing action type integer code |
gui.event.ACTIONTYPE_PERFORMING(): Integer |
Table of methods |
---|
Get image source of GUI image node |
gui.imagenode.getSource($imageNodeId: String): String |
Set image source of GUI image node |
gui.imagenode.setSource($imageNodeId: String, $source: String): Null |
Table of methods |
---|
Get GUI node controller value |
gui.node.controller.getValue($nodeId: String): String |
Set GUI node controller value |
gui.node.controller.setValue($nodeId: String, $value: String): Null |
Table of methods |
---|
Add sub nodes using XML to GUI parent node |
gui.parentnode.addSubNodes($parentNodeId: String, $xml: String[, $resetScrollOffsets: Boolean]): Null |
Clear sub nodes of GUI parent node |
gui.parentnode.clearSubNodes($parentNodeId: String): Null |
Replace sub nodes using XML of GUI parent node |
gui.parentnode.replaceSubNodes($parentNodeId: String, $xml: String[, $resetScrollOffsets: Boolean]): Null |
Table of methods |
---|
Return if GUI screen is enabled |
gui.screen.isEnabled($screenId: String): Boolean |
Set GUI screen enabled/disabled |
gui.screen.setEnabled($screenId: String, $enabled: Boolean): Null |
Call specific screen logic function |
gui.screen.call($screenId: String, $function: String, ...): Mixed |
Goto current screen to specific screen |
gui.screen.goto($fileName: String[, $variables: Map[, $arguments: Mixed]]): Null |
Pop current screen from screen stack |
gui.screen.pop(): Null |
Push screen to current screen stack |
gui.screen.push($fileName: String[, $variables: Map[, $arguments: Mixed]]): Null |
Table of methods |
---|
Get current screen node Id |
gui.screennode.getId(): String |
Table of methods |
---|
Get text of GUI text node |
gui.textnode.getText($textNodeId: String): String |
Set text of GUI text node |
gui.textnode.setText($textNodeId: String, $text: String): Null |
Table of methods |
---|
Get video source of GUI video node |
gui.videonode.getSource($videoNodeId: String): String |
Set video source of GUI video node |
gui.videonode.setSource($videoNodeId: String, $source: String): Null |
Table of methods |
---|
Returns if ALT key is currently pressed |
input.keyboard.isAltDown(): Boolean |
Returns if specific character is currently pressed |
input.keyboard.isCharDown($charAsString: String): Boolean |
Returns if CONTROL key is currently pressed |
input.keyboard.isControlDown(): Boolean |
Backspace key keycode |
input.keyboard.KEYCODE_BACKSPACE(): Integer |
Delete key keycode |
input.keyboard.KEYCODE_DELETE(): Integer |
Down key keycode |
input.keyboard.KEYCODE_DOWN(): Integer |
End key keycode |
input.keyboard.KEYCODE_END(): Integer |
Escape key keycode |
input.keyboard.KEYCODE_ESCAPE(): Integer |
F1 key keycode |
input.keyboard.KEYCODE_F1(): Integer |
F10 key keycode |
input.keyboard.KEYCODE_F10(): Integer |
F11 key keycode |
input.keyboard.KEYCODE_F11(): Integer |
F12 key keycode |
input.keyboard.KEYCODE_F12(): Integer |
F2 key keycode |
input.keyboard.KEYCODE_F2(): Integer |
F3 key keycode |
input.keyboard.KEYCODE_F3(): Integer |
F4 key keycode |
input.keyboard.KEYCODE_F4(): Integer |
F5 key keycode |
input.keyboard.KEYCODE_F5(): Integer |
F6 key keycode |
input.keyboard.KEYCODE_F6(): Integer |
F7 key keycode |
input.keyboard.KEYCODE_F7(): Integer |
F8 key keycode |
input.keyboard.KEYCODE_F8(): Integer |
F9 key keycode |
input.keyboard.KEYCODE_F9(): Integer |
Left key keycode |
input.keyboard.KEYCODE_LEFT(): Integer |
Page down key keycode |
input.keyboard.KEYCODE_PAGEDOWN(): Integer |
Page up key keycode |
input.keyboard.KEYCODE_PAGEUP(): Integer |
Home/position key keycode |
input.keyboard.KEYCODE_POS1(): Integer |
Return key keycode |
input.keyboard.KEYCODE_RETURN(): Integer |
Right key keycode |
input.keyboard.KEYCODE_RIGHT(): Integer |
Space key keycode |
input.keyboard.KEYCODE_SPACE(): Integer |
Up key keycode |
input.keyboard.KEYCODE_UP(): Integer |
Returns if specific key is currently pressed |
input.keyboard.isKeyDown($keyCode: Integer): Boolean |
Returns if meta key is currently pressed |
input.keyboard.isMetaDown(): Boolean |
Returns if shift key is currently pressed |
input.keyboard.isShiftDown(): Boolean |
Returns last typed String |
input.keyboard.getTypedString(): String |
Table of methods |
---|
Left mouse button integer code |
input.mouse.BUTTON_LEFT(): Integer |
Middle mouse button integer code |
input.mouse.BUTTON_MIDDLE(): Integer |
Right mouse button integer code |
input.mouse.BUTTON_RIGHT(): Integer |
Returns if specific mouse button is currently pressed |
input.mouse.isButtonDown($button: Integer): Boolean |
Returns if specific mouse button has been released |
input.mouse.isButtonUp($button: Integer): Boolean |
Returns if mouse is dragging currently |
input.mouse.isDragging($button: Integer): Boolean |
Returns if mouse has been moved |
input.mouse.hasMoved(): Boolean |
Returns current value of x axis mouse wheel |
input.mouse.getWheelX(): Float |
Returns current value of y axis mouse wheel |
input.mouse.getWheelY(): Float |
Returns current value of z axis mouse wheel |
input.mouse.getWheelZ(): Float |
Get x mouse position |
input.mouse.getX(): Integer |
Get unscaled x mouse position |
input.mouse.getXUnscaled(): Integer |
Get y mouse position |
input.mouse.getY(): Integer |
Get unscaled y mouse position |
input.mouse.getYUnscaled(): Integer |
- A-GUI, see README.md
- A-GUI - How to build, see README-BuildingHowTo.md
- The Mindty Kollektiv Discord Server