Module ncine.particle_affector

The table containing particle affectors related functions

Functions

ncine.particle_affector.get_type (affector) Returns the affector type
ncine.particle_affector.is_enabled (affector) Returns true if the affector is enabled
ncine.particle_affector.set_enabled (affector, enabled) Enables or disables the affector
ncine.particle_affector.num_steps (affector) Returns the number of steps
ncine.particle_affector.remove_steps (affector, index) Removes the step at the specified position index
ncine.particle_affector.clear_steps (affector) Removes all steps
ncine.particle_affector.get_color_steps (affector) Returns the color steps as a table (or nil if the affector type is not COLOR)
ncine.particle_affector.get_size_steps (affector) Returns the size steps as a table (or nil if the affector type is not SIZE)
ncine.particle_affector.get_rotation_steps (affector) Returns the rotation steps as a table (or nil if the affector type is not ROTATION)
ncine.particle_affector.get_position_steps (affector) Returns the position steps as a table (or nil if the affector type is not POSITION)
ncine.particle_affector.get_velocity_steps (affector) Returns the velocity steps as a table (or nil if the affector type is not VELOCITY)
ncine.particle_affector.add_color_step (affector, age, color) Adds a color step (if the affector type is COLOR)
ncine.particle_affector.add_color_step (affector, age, red, green, blue, alpha) Adds a color step (if the affector type is COLOR)
ncine.particle_affector.get_base_scale (affector) Returns a base scale factor that will be multiplied by all size steps.
ncine.particle_affector.set_base_scale (affector, base_scale) Sets a base scale factor that will be multiplied by all size steps.
ncine.particle_affector.add_size_step (affector, age, scale) Adds a size step (if the affector type is SIZE)
ncine.particle_affector.add_size_step (affector, age, scale_x, scale_y) Adds a size step (if the affector type is SIZE)
ncine.particle_affector.add_rotation_step (affector, age, angle) Adds a rotation step (if the affector type is ROTATION)
ncine.particle_affector.add_position_step (affector, age, position) Adds a position step (if the affector type is POSITION)
ncine.particle_affector.add_position_step (affector, age, position_x, position_y) Adds a position step (if the affector type is POSITION)
ncine.particle_affector.add_velocity_step (affector, age, velocity) Adds a velocity step (if the affector type is VELOCITY)
ncine.particle_affector.add_velocity_step (affector, age, velocity_x, velocity_y) Adds a velocity step (if the affector type is VELOCITY)

Tables

affectorObj The light user data of a particle affector object
ncine.affector_type Particle affector types (enumeration)
affector_color_step A step of a COLOR particle affector.
affector_size_step_factor A step of a SIZE particle affector.
affector_size_step_vector A step of a SIZE particle affector.
affector_rotation_step A step of a ROTATION particle affector.
affector_position_step A step of a POSITION particle affector.
affector_velocity_step A step of a VELOCITY particle affector.


Functions

ncine.particle_affector.get_type (affector)
Returns the affector type

Parameters:

Returns:

    ncine.affector_type
ncine.particle_affector.is_enabled (affector)
Returns true if the affector is enabled

Parameters:

Returns:

    boolean
ncine.particle_affector.set_enabled (affector, enabled)
Enables or disables the affector

Parameters:

ncine.particle_affector.num_steps (affector)
Returns the number of steps

Parameters:

Returns:

    integer
ncine.particle_affector.remove_steps (affector, index)
Removes the step at the specified position index

Parameters:

ncine.particle_affector.clear_steps (affector)
Removes all steps

Parameters:

ncine.particle_affector.get_color_steps (affector)
Returns the color steps as a table (or nil if the affector type is not COLOR)

Parameters:

Returns:

    affector_color_step[] or nil
ncine.particle_affector.get_size_steps (affector)
Returns the size steps as a table (or nil if the affector type is not SIZE)

Parameters:

Returns:

    affector_size_step_vector[] or nil
ncine.particle_affector.get_rotation_steps (affector)
Returns the rotation steps as a table (or nil if the affector type is not ROTATION)

Parameters:

Returns:

    affector_rotation_step[] or nil
ncine.particle_affector.get_position_steps (affector)
Returns the position steps as a table (or nil if the affector type is not POSITION)

Parameters:

Returns:

    affector_position_step[] or nil
ncine.particle_affector.get_velocity_steps (affector)
Returns the velocity steps as a table (or nil if the affector type is not VELOCITY)

Parameters:

Returns:

    affector_velocity_step[] or nil
ncine.particle_affector.add_color_step (affector, age, color)
Adds a color step (if the affector type is COLOR)

Parameters:

ncine.particle_affector.add_color_step (affector, age, red, green, blue, alpha)
Adds a color step (if the affector type is COLOR)

Parameters:

  • affector affectorObj
  • age number
  • red number
  • green number
  • blue number
  • alpha number
ncine.particle_affector.get_base_scale (affector)
Returns a base scale factor that will be multiplied by all size steps.

The affector type should be SIZE or the function will return nil.

Parameters:

Returns:

    ncine.vec2 or nil
ncine.particle_affector.set_base_scale (affector, base_scale)
Sets a base scale factor that will be multiplied by all size steps.

The affector type should be SIZE or the function will do nothing.

Parameters:

ncine.particle_affector.add_size_step (affector, age, scale)
Adds a size step (if the affector type is SIZE)

Parameters:

ncine.particle_affector.add_size_step (affector, age, scale_x, scale_y)
Adds a size step (if the affector type is SIZE)

Parameters:

  • affector affectorObj
  • age number
  • scale_x number
  • scale_y number
ncine.particle_affector.add_rotation_step (affector, age, angle)
Adds a rotation step (if the affector type is ROTATION)

Parameters:

ncine.particle_affector.add_position_step (affector, age, position)
Adds a position step (if the affector type is POSITION)

Parameters:

ncine.particle_affector.add_position_step (affector, age, position_x, position_y)
Adds a position step (if the affector type is POSITION)

Parameters:

  • affector affectorObj
  • age number
  • position_x number
  • position_y number
ncine.particle_affector.add_velocity_step (affector, age, velocity)
Adds a velocity step (if the affector type is VELOCITY)

Parameters:

ncine.particle_affector.add_velocity_step (affector, age, velocity_x, velocity_y)
Adds a velocity step (if the affector type is VELOCITY)

Parameters:

  • affector affectorObj
  • age number
  • velocity_x number
  • velocity_y number

Tables

affectorObj
The light user data of a particle affector object
ncine.affector_type
Particle affector types (enumeration)

Fields:

  • COLOR
  • SIZE
  • ROTATION
  • POSITION
  • VELOCITY
affector_color_step
A step of a COLOR particle affector.

It is an array of two elements, an age value and a color.

Fields:

  • color (ncine.color) Element at position [2]
  • age number Element at position [1]
affector_size_step_factor
A step of a SIZE particle affector.

It is an array of two elements, an age value and a uniform scale factor.

Fields:

  • age number Element at position [1]
  • scale number Element at position [2]
affector_size_step_vector
A step of a SIZE particle affector.

It is an array of two elements, an age value and a scale vector for the two dimensions.

Fields:

  • scale (ncine.vec2) Element at position [2]
  • age number Element at position [1]
affector_rotation_step
A step of a ROTATION particle affector.

It is an array of two elements, an age value and an angle in degrees.

Fields:

  • age number Element at position [1]
  • angle number Element at position [2]
affector_position_step
A step of a POSITION particle affector.

It is an array of two elements, an age value and a position vector.

Fields:

  • position (ncine.vec2) Element at position [2]
  • age number Element at position [1]
affector_velocity_step
A step of a VELOCITY particle affector.

It is an array of two elements, an age value and a velocity vector.

Fields:

  • velocity (ncine.vec2) Element at position [2]
  • age number Element at position [1]
generated by LDoc 1.5.0 Last updated 2024-12-18 15:08:56