Module ncine.particle_affector
The table containing particle affectors related functions
Functions
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:
- affector affectorObj
Returns:
-
ncine.affector_type
- ncine.particle_affector.is_enabled (affector)
-
Returns
true
if the affector is enabledParameters:
- affector affectorObj
Returns:
-
boolean
- ncine.particle_affector.set_enabled (affector, enabled)
-
Enables or disables the affector
Parameters:
- affector affectorObj
- enabled boolean
- ncine.particle_affector.num_steps (affector)
-
Returns the number of steps
Parameters:
- affector affectorObj
Returns:
-
integer
- ncine.particle_affector.remove_steps (affector, index)
-
Removes the step at the specified position index
Parameters:
- affector affectorObj
- index integer
- ncine.particle_affector.clear_steps (affector)
-
Removes all steps
Parameters:
- affector affectorObj
- ncine.particle_affector.get_color_steps (affector)
-
Returns the color steps as a table (or
nil
if the affector type is notCOLOR
)Parameters:
- affector affectorObj
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 notSIZE
)Parameters:
- affector affectorObj
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 notROTATION
)Parameters:
- affector affectorObj
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 notPOSITION
)Parameters:
- affector affectorObj
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 notVELOCITY
)Parameters:
- affector affectorObj
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:
- affector affectorObj
- age number
- color ncine.color
- 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 returnnil
.Parameters:
- affector affectorObj
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:
- affector affectorObj
- base_scale ncine.vec2
- ncine.particle_affector.add_size_step (affector, age, scale)
-
Adds a size step (if the affector type is
SIZE
)Parameters:
- affector affectorObj
- age number
- scale ncine.vec2
- 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:
- affector affectorObj
- age number
- angle number
- ncine.particle_affector.add_position_step (affector, age, position)
-
Adds a position step (if the affector type is
POSITION
)Parameters:
- affector affectorObj
- age number
- position ncine.vec2
- 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:
- affector affectorObj
- age number
- velocity ncine.vec2
- 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]