This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
gui_api [2019/12/11 17:17] – Added GUI:InputTextEditor kali | gui_api [2024/06/23 13:09] (current) – [Layout] husbandomax | ||
---|---|---|---|
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 320: | Line 324: | ||
*Returns: // | *Returns: // | ||
+ | ***'' | ||
+ | *Description: | ||
+ | ***'' | ||
+ | *Description: | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameter: | ||
+ | *column_index: | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //number// — The current column index. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //number// — The current row index. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //number// — The //number// of columns in the table. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //number// — The flags of the specified column. | ||
+ | *Parameter: | ||
+ | *column_index: | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameter: | ||
+ | *color: //number// — The color value. | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameters: | ||
+ | *column_index: | ||
+ | *width: //number// — The width to set. | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameters: | ||
+ | *column_index: | ||
+ | *ascending: //boolean// — true for ascending, false for descending. | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameters: | ||
+ | *label: //string// — The label of the column. | ||
+ | *flags: //number// — The flags for the column. | ||
+ | *init_width_or_weight: | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameter: | ||
+ | *label: //string// — The label of the header. | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameters: | ||
+ | *cols: //number// — The number of columns to freeze. | ||
+ | *rows: //number// — The number of rows to freeze. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //string// — The name of the specified column. | ||
+ | *Parameter: | ||
+ | *column_index: | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameters: | ||
+ | *column_index: | ||
+ | *enabled: //boolean// — true to enable, false to disable. | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameter: | ||
+ | *label: //string// — The label of the tab item. | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameter: | ||
+ | *label: //string// — The label of the button. | ||
+ | |||
+ | ***'' | ||
+ | *Description: | ||
+ | *Parameter: | ||
+ | *label: //string// — The label of the tab item to close. | ||
===Cursor=== | ===Cursor=== | ||
***'' | ***'' | ||
Line 606: | Line 712: | ||
===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 805: | Line 911: | ||
***'' | ***'' | ||
*Banana ;) | *Banana ;) | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //number// scrollV, //number// scrollH | ||
***'' | ***'' | ||
Line 811: | Line 920: | ||
***'' | ***'' | ||
*set text data to the clipboard | *set text data to the clipboard | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //boolean// — true if the item was edited. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //boolean// — true if the item was activated. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //boolean// — true if the item was deactivated. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //boolean// — true if the item was deactivated after an edit. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //boolean// — true if the item was toggled open. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //number// — The ID of the item. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //number// — The number of times the specified mouse button was clicked. | ||
+ | *Parameter: | ||
+ | *button: //number// — The mouse button. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //boolean// — true if the mouse position is valid. | ||
+ | |||
+ | ***'' | ||
+ | *Returns: //boolean// — true if any mouse button is down. | ||
+ | |||
+ | ===Custom Widgets=== | ||
+ | ***'' | ||
+ | *Returns: //number// virtualKey, //string// keyName, //boolean// changed | ||
+ | *Clicking the widget will start a listener for the next key press event | ||
Line 834: | Line 977: | ||
***'' | ***'' | ||
+ | |||
+ | ***'' | ||
+ | *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)// |