![]() |
naev 0.12.5
|
Bindings for GUI functionality from Lua. More...
#include "nlua_gui.h"#include "gui.h"#include "gui_omsg.h"#include "gui_osd.h"#include "map_overlay.h"#include "nlua_tex.h"
Go to the source code of this file.
Functions | |
| static int | guiL_viewport (lua_State *L) |
| Lua bindings to interact with the GUI elements. | |
| static int | guiL_fpsPos (lua_State *L) |
| Sets the position for the fps stuff. | |
| static int | guiL_osdInit (lua_State *L) |
| Initializes the mission OSD (on-screen display). | |
| static int | guiL_mesgInit (lua_State *L) |
| Sets up the message box from which the player receives input. | |
| static int | guiL_omsgInit (lua_State *L) |
| Sets the center of the omsg messages and width. | |
| static int | guiL_radarInit (lua_State *L) |
| Initializes the radar. | |
| static int | guiL_radarRender (lua_State *L) |
| Renders the radar. | |
| static int | guiL_targetSpobGFX (lua_State *L) |
| Sets the Lua spob target GFX. | |
| static int | guiL_targetPilotGFX (lua_State *L) |
| Sets the Lua pilot target GFX. | |
| static int | guiL_mouseClickEnable (lua_State *L) |
| Enables mouse clicking callback. | |
| static int | guiL_mouseMoveEnable (lua_State *L) |
| Enables mouse movement callback. | |
| static int | guiL_setMapOverlayBounds (lua_State *L) |
| Sets map boundaries. | |
| int | nlua_loadGUI (nlua_env env) |
| Loads the GUI library. | |
Variables | |
| static const luaL_Reg | guiL_methods [] |
Bindings for GUI functionality from Lua.
Definition in file nlua_gui.c.
|
static |
Sets the position for the fps stuff.
It can display the FPS and the current speed mod.
Lua function parameter: x X position for the fps stuff. Lua function parameter: y Y position for the fps stuff.
| L | Lua State |
Lua function: fpsPos
Definition at line 118 of file nlua_gui.c.
|
static |
Sets up the message box from which the player receives input.
Lua function parameter: number width Width of the message box. Lua function parameter: number x X position of message box. Lua function parameter: number y Y position of message box.
| L | Lua State |
Lua function: mesgInit
Definition at line 156 of file nlua_gui.c.
|
static |
Enables mouse clicking callback.
It enables receiving mouse clicks with a callback function like:
function mouse_click( button, x, y, state )
With button being the ID of the button, x/y being the position clicked and state being true if pressed, false if lifted. It should return true if it used the mouse event or false if it let it through.
Lua function parameter:[opt=true] boolean enable Whether or not to enable the mouse click callback.
| L | Lua State |
Lua function: mouseClickEnable
Definition at line 274 of file nlua_gui.c.
|
static |
Enables mouse movement callback.
It enables receiving mouse movements with a callback function like:
function mouse_move( x, y )
With x/y being the position of the mouse.
Lua function parameter:[opt] boolean enable Whether or not to enable the mouse movement callback.
| L | Lua State |
Lua function: mouseMoveEnable
Definition at line 296 of file nlua_gui.c.
|
static |
Sets the center of the omsg messages and width.
Lua function parameter: number width Width of the omsg messages. Lua function parameter: number x X center of the omsg messages. Lua function parameter: number y Y center of the omsg messages.
| L | Lua State |
Lua function: omsgInit
Definition at line 176 of file nlua_gui.c.
|
static |
Initializes the mission OSD (on-screen display).
Lua function parameter: number x X position of the OSD display. Lua function parameter: number y Y position of the OSD display. Lua function parameter: number w Width of the OSD display. Lua function parameter: number h Height of the OSD display.
| L | Lua State |
Lua function: osdInit
Definition at line 135 of file nlua_gui.c.
|
static |
Initializes the radar.
Lua usage parameter: gui.radarInit( true, 82 ) – Circular radar with 82 radius.
Lua function parameter: number circle Whether or not it should be a circle. Lua function parameter: number width Width if it's not a circle or radius if it is a circle. Lua function parameter: number height Only needed if not a circle.
| L | Lua State |
Lua function: radarInit
Definition at line 199 of file nlua_gui.c.
|
static |
Renders the radar.
Lua usage parameter: gui.radarRender( 50, 50 )
Lua function parameter: number x X position to render at. Lua function parameter: number y Y position to render at.
| L | Lua State |
Lua function: radarRender
Definition at line 226 of file nlua_gui.c.
|
static |
Sets map boundaries.
Lua function parameter: number top Top boundary in pixels Lua function parameter: number right Right boundary in pixels Lua function parameter: number bottom Bottom boundary in pixels Lua function parameter: number left Left boundary in pixels
| L | Lua State |
Lua function: setMapOverlayBounds
Definition at line 316 of file nlua_gui.c.
|
static |
Sets the Lua pilot target GFX.
Lua function parameter: Tex tex Texture to set for the pilot targeting.
| L | Lua State |
Lua function: targetPilotGFX
Definition at line 255 of file nlua_gui.c.
|
static |
Sets the Lua spob target GFX.
Lua function parameter: Tex tex Texture to set for the spob targeting.
| L | Lua State |
Lua function: targetSpobGFX
Definition at line 243 of file nlua_gui.c.
|
static |
Lua bindings to interact with the GUI elements.
An example would be:
Lua module: gui
Sets the gui viewport.
Basically this limits what the rest of the game considers as the screen. Careful when using this or you can make the game look ugly and unplayable. So use common sense and try to avoid windows smaller than 800x600 if possible.
Lua usage parameter: gui.viewport( 0, 0, screen_w, screen_h ) – Resets viewport. Lua usage parameter: gui.viewport( 0, 20, screen_w, screen_h-20 ) – Gives 20 pixels for a bottom bar.
Lua function parameter: number x X position to start clipping (bottom left is 0.) Lua function parameter: number y Y position to start clipping (bottom left is 0.) Lua function parameter: number w Width of the clipping (width of the screen is default). Lua function parameter: number h Height of the clipping (height of the screen is default).
| L | Lua State |
Lua function: viewport
Definition at line 96 of file nlua_gui.c.
| int nlua_loadGUI | ( | nlua_env | env | ) |
Loads the GUI library.
| env | Environment to load GUI library into. |
Definition at line 58 of file nlua_gui.c.
|
static |
GUI methods.
Definition at line 37 of file nlua_gui.c.