|
| static void | cust_cleanup (void *data) |
| | Cleans up after the window.
|
| 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, int isrepeat, 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.
|
| static int | tkL_query (lua_State *L) |
| | Gets the position and dimensions of either a window or a widget.
|
| static int | tkL_msg (lua_State *L) |
| | Creates a window with an ok button, and optionally an image.
|
| static int | tkL_yesno (lua_State *L) |
| | Displays a window with Yes and No buttons.
|
| static int | tkL_input (lua_State *L) |
| | Creates a window that allows player to write text input.
|
| static int | tkL_choice (lua_State *L) |
| | Creates a window with a number of selectable options.
|
| static int | tkL_list (lua_State *L) |
| | Creates a window with an embedded list of choices.
|
| static int | tkL_merchantOutfit (lua_State *L) |
| | Opens an outfit merchant window.
|
| static int | tkL_custom (lua_State *L) |
| | Creates a custom widget window.
|
| static int | tkL_customRename (lua_State *L) |
| | Renames the custom widget window.
|
| static int | tkL_customFullscreen (lua_State *L) |
| | Sets the custom widget fullscreen.
|
| static int | tkL_customResize (lua_State *L) |
| | Sets the custom widget fullscreen.
|
| static int | tkL_customSize (lua_State *L) |
| | Gets the size of a custom widget.
|
| static int | tkL_customDone (lua_State *L) |
| | Ends the execution of a custom widget.
|
| static int | tkL_refresh (lua_State *L) |
| | Forces the toolkit to rerender the screen.
|
| int | nlua_loadTk (nlua_env env) |
| | Loads the Toolkit Lua library.
|
| static unsigned int | dlgWid (lua_State *L) |
Naev toolkit Lua module.
Definition in file nlua_tk.c.
| 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 279 of file nlua_tk.c.
| int tkL_custom |
( |
lua_State * | L | ) |
|
|
static |
Creates a custom widget window.
Lua function parameter: String title Title of the window. Lua function parameter: Number width Width of the drawable area of the widget. Lua function parameter: Number height Height of the drawable area of the widget. Lua function parameter: Function update Function to call when updating. Should take a single parameter which is a number indicating how many seconds passed from previous update. Lua function parameter: Function draw Function to call when drawing. Lua function parameter: Function keyboard Function to call when keyboard events are received. Lua function parameter: Function mouse Function to call when mouse events are received. Lua function parameter: Function resize Function to call when mouse events are received. Lua function parameter: Function textinput Function to call when textinput events are received. Lua function parameter: boolean nodynamic Whether or not the dialogue should be not dynamic, or use tk.refresh to force rerenders.
- Parameters
-
- Returns
- Number of variables on the Lua State stack.
Lua function: custom
Definition at line 453 of file nlua_tk.c.
| 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 246 of file nlua_tk.c.
| 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 131 of file nlua_tk.c.
| 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 332 of file nlua_tk.c.
| 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). Lua function parameter: boolean blackmarket Whether or not the merchant is a black market merchant.
- Parameters
-
- Returns
- Number of variables on the Lua State stack.
Lua function: merchantOutfit
Definition at line 381 of file nlua_tk.c.
| 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 192 of file nlua_tk.c.
| 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 149 of file nlua_tk.c.
| 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 223 of file nlua_tk.c.