|
| static int | cust_update (double dt, void *data) |
| |
| static void | cust_render (double x, double y, double w, double h, void *data) |
| |
| static int | cust_event (unsigned int wid, SDL_Event *event, void *data) |
| |
| static int | cust_key (SDL_Keycode key, SDL_Keymod mod, int pressed, custom_functions_t *cf) |
| |
| static int | cust_text (const char *str, custom_functions_t *cf) |
| |
| static int | cust_mouse (int type, int button, double x, double y, custom_functions_t *cf) |
| |
| static int | cust_event_window (SDL_WindowEventID event, Sint32 w, Sint32 h, custom_functions_t *cf) |
| |
| static int | tkL_isOpen (lua_State *L) |
| | Bindings for interacting with the Toolkit. More...
|
| |
| static int | tkL_query (lua_State *L) |
| | Gets the position and dimensions of either a window or a widget. More...
|
| |
| static int | tkL_msg (lua_State *L) |
| | Creates a window with an ok button, and optionally an image. More...
|
| |
| static int | tkL_yesno (lua_State *L) |
| | Displays a window with Yes and No buttons. More...
|
| |
| static int | tkL_input (lua_State *L) |
| | Creates a window that allows player to write text input. More...
|
| |
| static int | tkL_choice (lua_State *L) |
| | Creates a window with a number of selectable options. More...
|
| |
| static int | tkL_list (lua_State *L) |
| | Creates a window with an embedded list of choices. More...
|
| |
| static int | tkL_merchantOutfit (lua_State *L) |
| | Opens an outfit merchant window. More...
|
| |
| static int | tkL_custom (lua_State *L) |
| | Creates a custom widget window. More...
|
| |
| static int | tkL_customRename (lua_State *L) |
| | Renames the custom widget window. More...
|
| |
| static int | tkL_customFullscreen (lua_State *L) |
| | Sets the custom widget fullscreen. More...
|
| |
| static int | tkL_customResize (lua_State *L) |
| | Sets the custom widget fullscreen. More...
|
| |
| static int | tkL_customSize (lua_State *L) |
| | Gets the size of a custom widget. More...
|
| |
| static int | tkL_customDone (lua_State *L) |
| | Ends the execution of a custom widget. More...
|
| |
| int | nlua_loadTk (nlua_env env) |
| | Loads the Toolkit Lua library. More...
|
| |
| static int | cust_pcall (lua_State *L, int nargs, int nresults) |
| |
Naev toolkit Lua module.
Definition in file nlua_tk.c.
| static int tkL_choice |
( |
lua_State * |
L | ) |
|
|
static |
Creates a window with a number of selectable options.
Lua usage parameter: num, chosen = tk.choice( "Title", "Ready to go?", "Yes", "No" ) – If "No" was clicked it would return 2, "No"
Lua function parameter: string title Title of the window. Lua function parameter: string msg Message to display. Lua function parameter: string choices Option choices. Lua return parameter: number The number of the choice chosen. Lua return parameter: string The name of the choice chosen.
- Parameters
-
- Returns
- Number of variables on the Lua State stack.
Lua function: choice
Definition at line 271 of file nlua_tk.c.
| static int tkL_input |
( |
lua_State * |
L | ) |
|
|
static |
Creates a window that allows player to write text input.
Lua usage parameter: name = tk.input( "Name", 3, 20, "Enter your name:" )
Lua function parameter: string title Title of the window. Lua function parameter: number min Minimum characters to accept (must be greater than 0). Lua function parameter: number max Maximum characters to accept. Lua function parameter: string str Text to display in the window. Lua return parameter: string|nil nil if input was canceled or a string with the text written.
- Parameters
-
- Returns
- Number of variables on the Lua State stack.
Lua function: input
Definition at line 238 of file nlua_tk.c.
| static int tkL_isOpen |
( |
lua_State * |
L | ) |
|
|
static |
Bindings for interacting with the Toolkit.
These toolkit bindings are all blocking, meaning that your Lua code won't continue executing until the user closes the dialogue that popped up.
A typical example would be:
tk.msg( "Title", "This is a message." )
if tk.yesno( "YesNo popup box", "Click yes to do something." ) then
-- Player clicked yes, do something
else
-- Player clicked no
end
Lua module: tk
Gets if the toolkit is open. This include any love2d windows.
Lua return parameter: boolean Whether or not the toolkit is open.
- Parameters
-
- Returns
- Number of variables on the Lua State stack.
Lua function: isOpen
Definition at line 123 of file nlua_tk.c.
| static int tkL_list |
( |
lua_State * |
L | ) |
|
|
static |
Creates a window with an embedded list of choices.
Lua usage parameter: num, chosen = tk.list( "Title", "Foo or bar?", "Foo", "Bar" ) – If "Bar" is clicked, it would return 2, "Bar"
Lua function parameter: string title Title of the window. Lua function parameter: string msg Message to display. Lua function parameter: string choices Option choices. Lua return parameter: number The number of the choice chosen. Lua return parameter: string The name of the choice chosen.
- Parameters
-
- Returns
- Number of variables on the Lua State stack.
Lua function: list
Definition at line 323 of file nlua_tk.c.
| static int tkL_merchantOutfit |
( |
lua_State * |
L | ) |
|
|
static |
Opens an outfit merchant window.
Lua usage parameter: tk.merchantOutfit( 'Laser Merchant', {'Laser Cannon MK0', 'Laser Cannon MK1'} ) Lua usage parameter: tk.merchantOutfit( 'Laser Merchant', {outfit.get('Laser Cannon MK0'), outfit.get('Laser Cannon MK1')} )
Lua function parameter: String name Name of the window. Lua function parameter: Table outfits Table of outfits to sell/buy. It is possible to use either outfits or outfit names (strings).
- Parameters
-
- Returns
- Number of variables on the Lua State stack.
Lua function: merchantOutfit
Definition at line 367 of file nlua_tk.c.
| static int tkL_msg |
( |
lua_State * |
L | ) |
|
|
static |
Creates a window with an ok button, and optionally an image.
Lua usage parameter: tk.msg( "Title", "This is a message." ) Lua usage parameter: tk.msg( "Title", "This is a message.", "character.png" )
Lua function parameter: string title Title of the window. Lua function parameter: string message Message to display in the window. Lua function parameter:[opt=-1] string image Image file to display in the window. Lua function parameter:[opt=-1] number width width of the image to display. Negative values use image width. Lua function parameter:[opt=-1] number height height of the image to display. Negative values use image height.
- Parameters
-
- Returns
- Number of variables on the Lua State stack.
Lua function: msg
Definition at line 182 of file nlua_tk.c.
| static int tkL_query |
( |
lua_State * |
L | ) |
|
|
static |
Gets the position and dimensions of either a window or a widget.
Lua function parameter: string wdwname Name of the window. Lua function parameter:[opt] string wgtname Name of the widget to get dimensions of. If not specified, the dimensions of the window are returned. Lua return parameter: number X position of the window/widget. Lua return parameter: number Y position of the window/widget. Lua return parameter: number Width of the window/widget. Lua return parameter: number Height of the window/widget.
- Parameters
-
- Returns
- Number of variables on the Lua State stack.
Lua function: query
Definition at line 140 of file nlua_tk.c.
| static int tkL_yesno |
( |
lua_State * |
L | ) |
|
|
static |
Displays a window with Yes and No buttons.
Lua usage parameter: if tk.yesno( "YesNo popup box", "Click yes to do something." ) then – Clicked yes
Lua function parameter: string title Title of the window. Lua function parameter: string message Message to display in the window. Lua return parameter: boolean true if yes was clicked, false if no was clicked.
- Parameters
-
- Returns
- Number of variables on the Lua State stack.
Lua function: yesno
Definition at line 214 of file nlua_tk.c.