Module ncine.particle_system

The table containing particle system related functions.

Inherits from ncine.scenenode.

Functions

ncine.particle_system.new (parent, count, texture, tex_rect) Constructs a particle system.
ncine.particle_system.clone (particle_system) Constructs a new particle system object as a clone of the specified one.
ncine.particle_system.delete (particle_system) Destroys a particle system object and releases its memory
ncine.particle_system.add_color_affector (particle_system, color_steps) Adds a color particle affector
ncine.particle_system.add_size_affector (particle_system, base_scale, size_steps) Adds a size particle affector
ncine.particle_system.add_size_affector (particle_system, base_scale, size_steps) Adds a size particle affector
ncine.particle_system.add_rotation_affector (particle_system, rotation_steps) Adds a rotation particle affector
ncine.particle_system.add_position_affector (particle_system, position_steps) Adds a position particle affector
ncine.particle_system.add_velocity_affector (particle_system, velocity_steps) Adds a velocity particle affector
ncine.particle_system.num_affectors (particle_system) Returns the number of affectors
ncine.particle_system.get_affector (particle_system, index) Returns the affector at the specified index
ncine.particle_system.remove_affector (particle_system, index) Removes the affector at the specified index
ncine.particle_system.clear_affectors (particle_system) Deletes all particle affectors
ncine.particle_system.emit_particles (particle_system, initializer) Emits particles with the specified initialization parameters
ncine.particle_system.kill_particles (particle_system) Kills all alive particles
ncine.particle_system.get_in_local_space (particle_system) Returns true if particles are positioned using the particle system as their origin
ncine.particle_system.set_in_local_space (particle_system, local_space) Sets or clears the local space flag, to move particles around the particle system or freely
ncine.particle_system.get_particles_update_enabled (particle_system) Returns true if particles are updating
ncine.particle_system.set_particles_update_enabled (particle_system, enabled) Enables or disables particles updating
ncine.particle_system.get_affectors_enabled (particle_system) Returns true if affectors are modifying particles properties
ncine.particle_system.set_affectors_enabled (particle_system, enabled) Enables or disables affectors modifying particles properties
ncine.particle_system.num_particles (particle_system) Returns the total number of particles in the system
ncine.particle_system.num_alive_particles (particle_system) Returns the number of particles currently alive
ncine.particle_system.set_texture (particle_system, texture) Sets the texture object for every particle in the system
ncine.particle_system.set_texture_rect (particle_system, tex_rect) Sets the texture source rectangle for every particle in the system
ncine.particle_system.set_anchor_point (particle_system, point) Sets the transformation anchor point for every particle in the system with a ncine.vec2
ncine.particle_system.set_anchor_point (particle_system, point_x, point_y) Sets the transformation anchor point for every particle in the system
ncine.particle_system.set_flipped_x (particle_system, flipped_x) Flips the texture rect horizontally for every particle in the system
ncine.particle_system.set_flipped_y (particle_system, flipped_y) Flips the texture rect vertically for every particle in the system
ncine.particle_system.set_blending_preset (particle_system, blending_preset) Sets the blending factors preset for every particle in the system
ncine.particle_system.set_blending_factors (particle_system, src_factor, dest_factor) Sets the source and destination blending factors for every particle in the system
ncine.particle_system.set_layer (particle_system, layer) Sets the rendering layer for every particle in the system

Tables

particlesystemObj The light user data of a particle system object.
particle_initializer An initializer table with random ranges used to emit particles.


Functions

ncine.particle_system.new (parent, count, texture, tex_rect)
Constructs a particle system.

Don’t forget to call ncine.particle_system.delete when you are done with it!

Parameters:

Returns:

    particlesystemObj A new particle system object
ncine.particle_system.clone (particle_system)
Constructs a new particle system object as a clone of the specified one.

Don’t forget to call ncine.particle_system.delete when you are done with it!

Parameters:

Returns:

    particlesystemObj The cloned particle system object
ncine.particle_system.delete (particle_system)
Destroys a particle system object and releases its memory

Parameters:

ncine.particle_system.add_color_affector (particle_system, color_steps)
Adds a color particle affector

Parameters:

  • particle_system particlesystemObj
  • color_steps ncine.particle_affector.affector_color_step[]
ncine.particle_system.add_size_affector (particle_system, base_scale, size_steps)
Adds a size particle affector

Parameters:

  • particle_system particlesystemObj
  • base_scale number
  • size_steps ncine.particle_affector.affector_size_step_factor[]
ncine.particle_system.add_size_affector (particle_system, base_scale, size_steps)
Adds a size particle affector

Parameters:

  • particle_system particlesystemObj
  • base_scale number
  • size_steps ncine.particle_affector.affector_size_step_vector[]
ncine.particle_system.add_rotation_affector (particle_system, rotation_steps)
Adds a rotation particle affector

Parameters:

  • particle_system particlesystemObj
  • rotation_steps ncine.particle_affector.affector_rotation_step[]
ncine.particle_system.add_position_affector (particle_system, position_steps)
Adds a position particle affector

Parameters:

  • particle_system particlesystemObj
  • position_steps ncine.particle_affector.affector_position_step[]
ncine.particle_system.add_velocity_affector (particle_system, velocity_steps)
Adds a velocity particle affector

Parameters:

  • particle_system particlesystemObj
  • velocity_steps ncine.particle_affector.affector_velocity_step[]
ncine.particle_system.num_affectors (particle_system)
Returns the number of affectors

Parameters:

Returns:

    integer
ncine.particle_system.get_affector (particle_system, index)
Returns the affector at the specified index

Parameters:

Returns:

    ncine.particle_affector.affectorObj or nil
ncine.particle_system.remove_affector (particle_system, index)
Removes the affector at the specified index

Parameters:

ncine.particle_system.clear_affectors (particle_system)
Deletes all particle affectors

Parameters:

ncine.particle_system.emit_particles (particle_system, initializer)
Emits particles with the specified initialization parameters

Parameters:

ncine.particle_system.kill_particles (particle_system)
Kills all alive particles

Parameters:

ncine.particle_system.get_in_local_space (particle_system)
Returns true if particles are positioned using the particle system as their origin

Parameters:

Returns:

    boolean
ncine.particle_system.set_in_local_space (particle_system, local_space)
Sets or clears the local space flag, to move particles around the particle system or freely

Parameters:

ncine.particle_system.get_particles_update_enabled (particle_system)
Returns true if particles are updating

Parameters:

Returns:

    boolean
ncine.particle_system.set_particles_update_enabled (particle_system, enabled)
Enables or disables particles updating

Parameters:

ncine.particle_system.get_affectors_enabled (particle_system)
Returns true if affectors are modifying particles properties

Parameters:

Returns:

    boolean
ncine.particle_system.set_affectors_enabled (particle_system, enabled)
Enables or disables affectors modifying particles properties

Parameters:

ncine.particle_system.num_particles (particle_system)
Returns the total number of particles in the system

Parameters:

Returns:

    integer
ncine.particle_system.num_alive_particles (particle_system)
Returns the number of particles currently alive

Parameters:

Returns:

    integer
ncine.particle_system.set_texture (particle_system, texture)
Sets the texture object for every particle in the system

Parameters:

ncine.particle_system.set_texture_rect (particle_system, tex_rect)
Sets the texture source rectangle for every particle in the system

Parameters:

ncine.particle_system.set_anchor_point (particle_system, point)
Sets the transformation anchor point for every particle in the system with a ncine.vec2

Parameters:

ncine.particle_system.set_anchor_point (particle_system, point_x, point_y)
Sets the transformation anchor point for every particle in the system

Parameters:

ncine.particle_system.set_flipped_x (particle_system, flipped_x)
Flips the texture rect horizontally for every particle in the system

Parameters:

ncine.particle_system.set_flipped_y (particle_system, flipped_y)
Flips the texture rect vertically for every particle in the system

Parameters:

ncine.particle_system.set_blending_preset (particle_system, blending_preset)
Sets the blending factors preset for every particle in the system

Parameters:

ncine.particle_system.set_blending_factors (particle_system, src_factor, dest_factor)
Sets the source and destination blending factors for every particle in the system

Parameters:

  • particle_system particlesystemObj
  • src_factor ncine.blending_factor
  • dest_factor ncine.blending_factor
ncine.particle_system.set_layer (particle_system, layer)
Sets the rendering layer for every particle in the system

Parameters:

Tables

particlesystemObj
The light user data of a particle system object.

Inherits from ncine.scenenode.scenenodeObj.

particle_initializer
An initializer table with random ranges used to emit particles.

Each field can be the precise value, or an array of two elements, to define a minimum and a maximum.

Fields:

  • amount (number|number[2])
  • life (number|number[2])
  • position (ncine.vec2|ncine.vec2[2])
  • velocity (ncine.vec2|ncine.vec2[2])
  • rotation (number|number[2])
generated by LDoc 1.5.0 Last updated 2024-12-18 15:08:56