Naev

Module spfx

Lua bindings to interact with spfx.

Functions

__gc (spfx) Frees a spfx.
__eq (s1, s2) Compares two spfxs to see if they are the same.
new (ttl, update, render_bg, render_mg, render_fg, pos, vel, sfx) Creates a new special effect.
rm (s) Removes a special effect.
pos (s) Gets the position of a spfx.
vel (s) Gets the velocity of a spfx.
vel (s) Gets the sound effect of a spfx.
data (s) Gets the data table of a spfx.

Fields

Delta Updates the spfx.


Functions

__gc (spfx)
Frees a spfx.

Parameters:

  • spfx Spfx Spfx to free.
__eq (s1, s2)
Compares two spfxs to see if they are the same.

Parameters:

  • s1 Spfx Spfx 1 to compare.
  • s2 Spfx Spfx 2 to compare.

Returns:

    boolean true if both spfxs are the same.
new (ttl, update, render_bg, render_mg, render_fg, pos, vel, sfx)
Creates a new special effect.

Parameters:

  • ttl Number Time to live of the effect.
  • update Function or nil Update function to use if applicable.
  • render_bg Function or nil Background render function to use if applicable (behind ships).
  • render_mg Function or nil Middle render function to use if applicable (infront of NPC ships, behind player).
  • render_fg Function or nil Foregroundrender function to use if applicable (infront of player).
  • pos vec2 or boolean Position of the effect, or a boolean to indicate whether or not the effect is local.
  • vel vec2 Velocity of the effect.
  • sfx audio Sound effect associated with the spfx.

Returns:

    spfx New spfx corresponding to the data.

Usage:

  • spfx.new( 5, update, nil, nil, render, player.pos(), player.pilot():vel(), sfx ) -- Play effect with update and render functions at player position/velocity
    
  • spfx.new( 10, nil, nil, nil, nil, true, nil, sfx ) -- Play an effect locally (affected by time compression and autonav stuff)
    
  • spfx.new( 10, nil, nil, nil, nil, nil, nil, sfx ) -- Play a global effect (not affected by time stuff )
    
rm (s)
Removes a special effect.

Parameters:

  • s spfx Spfx to remove.
pos (s)
Gets the position of a spfx. ( s )

Parameters:

  • s spfx Spfx to get position of.

Returns:

    vec2 Position of the spfx.
vel (s)
Gets the velocity of a spfx.

Parameters:

  • s spfx Spfx to get velocity of.

Returns:

    vec2 Velocity of the spfx.
vel (s)
Gets the sound effect of a spfx.

Parameters:

  • s spfx Spfx to get sound effect of.

Returns:

    audio Sound effect of the spfx.
data (s)
Gets the data table of a spfx.

This table is unique to each instance.

Parameters:

  • s spfx Spfx to get data table of.

Returns:

    table Data table of the spfx.

Fields

Delta
Updates the spfx.
  • Delta dt tick to use for the update.
generated by LDoc 1.4.6 Last updated 2022-07-03 21:38:21