This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
gui_api [2019/08/19 08:20] – fxfire | gui_api [2023/04/21 07:34] (current) – kali | ||
---|---|---|---|
Line 40: | Line 40: | ||
===Important Information=== | ===Important Information=== | ||
* To get an overview what is possible with the GUI, open the ingame console (CTRL + C) and execute this command: '' | * To get an overview what is possible with the GUI, open the ingame console (CTRL + C) and execute this command: '' | ||
+ | * **AUTOMATIC TRANSLATIONS** - Wrap all your static text like: GUI: | ||
* If you find something in that Testwindow but you are not sure how to code the same in LUA, have a look in the c++ source of it: [[https:// | * If you find something in that Testwindow but you are not sure how to code the same in LUA, have a look in the c++ source of it: [[https:// | ||
Line 52: | Line 53: | ||
GUI: | GUI: | ||
GUI: | GUI: | ||
+ | Example: Different name in UI, same internal identifier with auto **Translations**: | ||
+ | GUI: | ||
+ | GUI: | ||
</ | </ | ||
Line 285: | Line 289: | ||
***'' | ***'' | ||
- | *setup number of columns. use an identifier to distinguish multiple column sets. close with Columns(1). | + | *setup number of columns. use an identifier to distinguish multiple column sets. **close with Columns(1)**. |
***'' | ***'' | ||
Line 468: | Line 472: | ||
***'' | ***'' | ||
*Returns: //string// text, //bool// changed | *Returns: //string// text, //bool// changed | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //string// text, //bool// changed | ||
+ | *Lua syntax highlighting version of GUI: | ||
***'' | ***'' | ||
Line 602: | Line 610: | ||
===Widgets Tooltip=== | ===Widgets Tooltip=== | ||
***'' | ***'' | ||
- | *set tooltip under mouse-cursor, | + | *set tooltip under mouse-cursor, |
***'' | ***'' | ||
*use to create full-featured tooltip windows that aren't just text | *use to create full-featured tooltip windows that aren't just text | ||
Line 807: | Line 815: | ||
***'' | ***'' | ||
*set text data to the clipboard | *set text data to the clipboard | ||
+ | |||
+ | |||
+ | |||
+ | ===Custom Widgets=== | ||
+ | ***'' | ||
+ | *Returns: //number// virtualKey, //string// keyName, //boolean// changed | ||
+ | *Clicking the widget will start a listener for the next key press event | ||
Line 830: | Line 845: | ||
***'' | ***'' | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //number// X1, //number// Y1, screenpos | ||
+ | *USE THIS ONE IF POSSIBLE, it is A LOT FASTER than the one below! Converts a worldposition x,y,z to a screenposition x,y , IF that point is currently visible on the screen | ||
***'' | ***'' | ||
*Returns: //table// screenpos | *Returns: //table// screenpos | ||
*Converts a worldposition x,y,z to a screenposition x,y , IF that point is currently visible on the screen | *Converts a worldposition x,y,z to a screenposition x,y , IF that point is currently visible on the screen | ||
+ | |||
===Enums & Flags=== | ===Enums & Flags=== | ||
These are registered values in the GUI metatable. //Usage: d(GUI.WindowFlags_NoMove)// | These are registered values in the GUI metatable. //Usage: d(GUI.WindowFlags_NoMove)// |