Home

Module naev

Naev generic Lua bindings.

An example would be:

 if naev.lang() == "en" then
    --Language is English.
 end
 

Functions

lang () Gets the language Naev is currently using.
ticks () Gets the SDL ticks.
keyGet (keyname) Gets the keybinding value by name.
keyEnable (keyname[, enable=false]) Disables or enables a specific keybinding.
keyEnableAll () Enables all inputs.
keyDisableAll () Disables all inputs.
eventStart (evtname) Starts an event, does not start check conditions.
missionStart (misnname) Starts a mission, does no check start conditions.


Functions

lang ()
Gets the language Naev is currently using. ()

Returns:

    string Two character identifier of the language.

Usage:

    if naev.lang() == "en" then -- Language is english
ticks ()
Gets the SDL ticks.

Useful for doing timing on Lua functions. ()

Returns:

    number The SDL ticks since the application started running.
keyGet (keyname)
Gets the keybinding value by name. ( keyname )

Parameters:

  • keyname string Name of the keybinding to get value of.

Usage:

    bindname = naev.keyGet( "accel" )
keyEnable (keyname[, enable=false])
Disables or enables a specific keybinding.

Use with caution, this can make the player get stuck. ( keyname, enable )

Parameters:

  • keyname string Name of the key to disable (for example "accel").
  • enable boolean Whether to enable or disable. (default false)

Usage:

    naev.keyEnable( "accel", false ) -- Disables the acceleration key
keyEnableAll ()
Enables all inputs. ()

Usage:

    naev.keyEnableAll() -- Enables all inputs
keyDisableAll ()
Disables all inputs. ()

Usage:

    naev.keyDisableAll() -- Disables all inputs
eventStart (evtname)
Starts an event, does not start check conditions. ( evtname )

Parameters:

  • evtname string Name of the event to start.

Returns:

    boolean true on success.

Usage:

    naev.eventStart( "Some Event" )
missionStart (misnname)
Starts a mission, does no check start conditions. ( misnname )

Parameters:

  • misnname string Name of the mission to start.

Returns:

    boolean true on success.

Usage:

    naev.missionStart( "Some Mission" )
generated by LDoc 1.4.3 Last updated 2020-06-26 02:01:09