Pixelpart 1.8.2
Godot Plugin
Loading...
Searching...
No Matches
godot::PixelpartEffect2D Class Reference

A node that plays a Pixelpart effect. More...

Public Member Functions

void set_effect (Ref< PixelpartEffectResource > resource)
 Change the effect resource that is shown.
 
Ref< PixelpartEffectResourceget_effect () const
 Return the effect resource that is being shown.
 
void play (bool state)
 Start playing or pause simulation of the effect.
 
void pause ()
 Pause simulation of the effect.
 
void restart ()
 Restart the effect and remove all existing particles.
 
void reset ()
 Restart the effect, but do not remove existing particles.
 
bool is_playing () const
 Return whether the effect is currently playing or is paused.
 
float get_time () const
 Return the time in seconds since the effect has started playing.
 
void set_loop (bool mode)
 Set whether the effect restarts automatically after time loop_time.
 
bool get_loop () const
 Return whether the effect restarts automatically after time loop_time.
 
void set_loop_time (float time)
 Set time in seconds after which the effect loops.
 
float get_loop_time () const
 Return time in seconds after which the effect loops.
 
void set_warmup_time (float time)
 Set time in seconds the effect is pre-simulated before being rendered.
 
float get_warmup_time () const
 Return time in seconds the effect is pre-simulated before being rendered.
 
void set_speed (float sp)
 Set how fast the effect is being played.
 
float get_speed () const
 Return how fast the effect is being played.
 
void set_frame_rate (float rate)
 Set at which rate the effect is simulated, in frames per second.
 
float get_frame_rate () const
 Return at which rate the effect is simulated, in frames per second.
 
void set_effect_scale (float scale)
 Set multiplier for the size of the effect.
 
float get_effect_scale () const
 Return multiplier for the size of the effect.
 
void set_flip_h (bool flip)
 Set whether the effect is flipped horizontally.
 
void set_flip_v (bool flip)
 Set whether the effect is flipped vertically.
 
bool get_flip_h () const
 Return whether the effect is flipped horizontally.
 
bool get_flip_v () const
 Return whether the effect is flipped vertically.
 
void set_inputs (Dictionary inputs)
 Set dictionary of effect input values.
 
Dictionary get_inputs () const
 Return dictionary of effect input values.
 
void set_input_bool (String name, bool value)
 
void set_input_int (String name, int value)
 
void set_input_float (String name, float value)
 
void set_input_float2 (String name, Vector2 value)
 
void set_input_float3 (String name, Vector3 value)
 
void set_input_float4 (String name, Vector4 value)
 
bool get_input_bool (String name) const
 Return value of an effect input. The effect input must be of type bool.
 
int get_input_int (String name) const
 Return value of an effect input. The effect input must be of type int.
 
float get_input_float (String name) const
 Return value of an effect input. The effect input must be of type float.
 
Vector2 get_input_float2 (String name) const
 Return value of an effect input. The effect input must be of type Vector2.
 
Vector3 get_input_float3 (String name) const
 Return value of an effect input. The effect input must be of type Vector3.
 
Vector4 get_input_float4 (String name) const
 Return value of an effect input. The effect input must be of type Vector4.
 
int get_input_type (String name) const
 Return the type of an effect input or -1 if the effect input does not exist.
 
TypedArray< String > get_input_names () const
 Return names of available effect inputs.
 
void activate_trigger (String name)
 Activate trigger name.
 
bool is_trigger_activated (String name) const
 Return whether trigger name was activated.
 
void spawn_particles (String particleEmitterName, String particleTypeName, int count)
 Generate count particles of the given type from the given emitter.
 
Ref< PixelpartNodefind_node (String name) const
 Return the node with the given name.
 
Ref< PixelpartNodeget_node (int id) const
 Return the node with the given ID.
 
Ref< PixelpartNodeget_node_at_index (int index) const
 Return the node at the given index.
 
Ref< PixelpartParticleTypefind_particle_type (String name) const
 Return the particle type with the given name.
 
Ref< PixelpartParticleTypeget_particle_type (int id) const
 Return the particle type with the given ID.
 
Ref< PixelpartParticleTypeget_particle_type_at_index (int index) const
 Return the particle type at the given index.
 
Ref< PixelpartParticleEmitterfind_particle_emitter (String name) const
 Return the particle emitter with the given name.
 
Ref< PixelpartForceFieldfind_force_field (String name) const
 Return the force field with the given name.
 
Ref< PixelpartColliderfind_collider (String name) const
 Return the collider with the given name.
 
Ref< PixelpartParticleEmitterget_particle_emitter (int id) const
 Return the particle emitter with the given ID.
 
Ref< PixelpartForceFieldget_force_field (int id) const
 Return the force field with the given ID.
 
Ref< PixelpartColliderget_collider (int id) const
 Return the collider with the given ID.
 
Ref< PixelpartParticleEmitterget_particle_emitter_at_index (int index) const
 Return the particle emitter at the given index.
 
Ref< PixelpartForceFieldget_force_field_at_index (int index) const
 Return the force field at the given index.
 
Ref< PixelpartColliderget_collider_at_index (int index) const
 Return the collider at the given index.
 

Public Attributes

PixelpartEffectResource effect
 Effect resource that is shown.
 
bool playing
 Whether the effect is currently playing or not.
 
bool loop
 Whether the effect restarts automatically after time loop_time.
 
float loop_time
 Time in seconds after which the effect loops.
 
float warmup_time
 Time in seconds the effect is pre-simulated before being rendered.
 
float speed
 How fast the effect is being played.
 
float frame_rate
 At which rate the effect is simulated, in frames per second.
 
Dictionary inputs
 Dictionary of effect input values.
 
float effect_scale
 Multiplier for the size of the effect.
 
bool flip_h
 Whether the effect is flipped horizontally.
 
bool flip_v
 Whether the effect is flipped vertically.
 

Detailed Description

A node that plays a Pixelpart effect.

This class offers methods and properties to change how the effect is simulated and rendered.

Member Function Documentation

◆ activate_trigger()

void godot::PixelpartEffect2D::activate_trigger ( String name)

Activate trigger name.

Parameters
nameName of the trigger

◆ find_collider()

Ref< PixelpartCollider > godot::PixelpartEffect2D::find_collider ( String name) const

Return the collider with the given name.

Deprecated
Use find_node instead.
Parameters
nameNode name
Returns
Node or null if no node with this name exists

◆ find_force_field()

Ref< PixelpartForceField > godot::PixelpartEffect2D::find_force_field ( String name) const

Return the force field with the given name.

Deprecated
Use find_node instead.
Parameters
nameNode name
Returns
Node or null if no node with this name exists

◆ find_node()

Ref< PixelpartNode > godot::PixelpartEffect2D::find_node ( String name) const

Return the node with the given name.

Parameters
nameNode name
Returns
Node or null if no node with this name exists

◆ find_particle_emitter()

Ref< PixelpartParticleEmitter > godot::PixelpartEffect2D::find_particle_emitter ( String name) const

Return the particle emitter with the given name.

Deprecated
Use find_node instead.
Parameters
nameNode name
Returns
Node or null if no node with this name exists

◆ find_particle_type()

Ref< PixelpartParticleType > godot::PixelpartEffect2D::find_particle_type ( String name) const

Return the particle type with the given name.

Parameters
nameParticle type name
Returns
Particle type or null if no particle type with this name exists

◆ get_collider()

Ref< PixelpartCollider > godot::PixelpartEffect2D::get_collider ( int id) const

Return the collider with the given ID.

Deprecated
Use get_node instead.
Parameters
idNode ID
Returns
Node or null if no node with this ID exists

◆ get_collider_at_index()

Ref< PixelpartCollider > godot::PixelpartEffect2D::get_collider_at_index ( int index) const

Return the collider at the given index.

Deprecated
Use get_node_at_index instead.
Parameters
indexNode index
Returns
Node or null if no node at this index exists

◆ get_effect()

Ref< PixelpartEffectResource > godot::PixelpartEffect2D::get_effect ( ) const

Return the effect resource that is being shown.

Returns
Effect resource

◆ get_effect_scale()

float godot::PixelpartEffect2D::get_effect_scale ( ) const

Return multiplier for the size of the effect.

Returns
Effect scale

◆ get_flip_h()

bool godot::PixelpartEffect2D::get_flip_h ( ) const

Return whether the effect is flipped horizontally.

Parameters
flipFlipped

◆ get_flip_v()

bool godot::PixelpartEffect2D::get_flip_v ( ) const

Return whether the effect is flipped vertically.

Parameters
flipFlipped

◆ get_force_field()

Ref< PixelpartForceField > godot::PixelpartEffect2D::get_force_field ( int id) const

Return the force field with the given ID.

Deprecated
Use get_node instead.
Parameters
idNode ID
Returns
Node or null if no node with this ID exists

◆ get_force_field_at_index()

Ref< PixelpartForceField > godot::PixelpartEffect2D::get_force_field_at_index ( int index) const

Return the force field at the given index.

Deprecated
Use get_node_at_index instead.
Parameters
indexNode index
Returns
Node or null if no node at this index exists

◆ get_frame_rate()

float godot::PixelpartEffect2D::get_frame_rate ( ) const

Return at which rate the effect is simulated, in frames per second.

Returns
Frame rate, in frames per second

◆ get_input_bool()

bool godot::PixelpartEffect2D::get_input_bool ( String name) const

Return value of an effect input. The effect input must be of type bool.

Parameters
nameName of the effect input
Returns
Value of the effect input

◆ get_input_float()

float godot::PixelpartEffect2D::get_input_float ( String name) const

Return value of an effect input. The effect input must be of type float.

Parameters
nameName of the effect input
Returns
Value of the effect input

◆ get_input_float2()

Vector2 godot::PixelpartEffect2D::get_input_float2 ( String name) const

Return value of an effect input. The effect input must be of type Vector2.

Parameters
nameName of the effect input
Returns
Value of the effect input

◆ get_input_float3()

Vector3 godot::PixelpartEffect2D::get_input_float3 ( String name) const

Return value of an effect input. The effect input must be of type Vector3.

Parameters
nameName of the effect input
Returns
Value of the effect input

◆ get_input_float4()

Vector4 godot::PixelpartEffect2D::get_input_float4 ( String name) const

Return value of an effect input. The effect input must be of type Vector4.

Parameters
nameName of the effect input
Returns
Value of the effect input

◆ get_input_int()

int godot::PixelpartEffect2D::get_input_int ( String name) const

Return value of an effect input. The effect input must be of type int.

Parameters
nameName of the effect input
Returns
Value of the effect input

◆ get_input_names()

TypedArray< String > godot::PixelpartEffect2D::get_input_names ( ) const

Return names of available effect inputs.

Returns
Array with effect input names

◆ get_input_type()

int godot::PixelpartEffect2D::get_input_type ( String name) const

Return the type of an effect input or -1 if the effect input does not exist.

Parameters
nameName of the effect input
Returns
Type index

◆ get_inputs()

Dictionary godot::PixelpartEffect2D::get_inputs ( ) const

Return dictionary of effect input values.

Do not use to change effect inputs at runtime, use the set_input methods instead.

Returns
Effect input values

◆ get_loop()

bool godot::PixelpartEffect2D::get_loop ( ) const

Return whether the effect restarts automatically after time loop_time.

Returns
Loop mode

◆ get_loop_time()

float godot::PixelpartEffect2D::get_loop_time ( ) const

Return time in seconds after which the effect loops.

Returns
Loop time in seconds

◆ get_node()

Ref< PixelpartNode > godot::PixelpartEffect2D::get_node ( int id) const

Return the node with the given ID.

Parameters
idNode ID
Returns
Node or null if no node with this ID exists

◆ get_node_at_index()

Ref< PixelpartNode > godot::PixelpartEffect2D::get_node_at_index ( int index) const

Return the node at the given index.

Parameters
indexNode index, starting from 0
Returns
Node or null if no node at this index exists

◆ get_particle_emitter()

Ref< PixelpartParticleEmitter > godot::PixelpartEffect2D::get_particle_emitter ( int id) const

Return the particle emitter with the given ID.

Deprecated
Use get_node instead.
Parameters
idNode ID
Returns
Node or null if no node with this ID exists

◆ get_particle_emitter_at_index()

Ref< PixelpartParticleEmitter > godot::PixelpartEffect2D::get_particle_emitter_at_index ( int index) const

Return the particle emitter at the given index.

Deprecated
Use get_node_at_index instead.
Parameters
indexNode index
Returns
Node or null if no node at this index exists

◆ get_particle_type()

Ref< PixelpartParticleType > godot::PixelpartEffect2D::get_particle_type ( int id) const

Return the particle type with the given ID.

Parameters
idParticle type ID
Returns
Particle type or null if no particle type with this ID exists

◆ get_particle_type_at_index()

Ref< PixelpartParticleType > godot::PixelpartEffect2D::get_particle_type_at_index ( int index) const

Return the particle type at the given index.

Parameters
indexParticle type index
Returns
Particle type or null if no particle type at this index exists

◆ get_speed()

float godot::PixelpartEffect2D::get_speed ( ) const

Return how fast the effect is being played.

Returns
Speed multiplier

◆ get_time()

float godot::PixelpartEffect2D::get_time ( ) const

Return the time in seconds since the effect has started playing.

Returns
Time in seconds since the effect has started playing.

◆ get_warmup_time()

float godot::PixelpartEffect2D::get_warmup_time ( ) const

Return time in seconds the effect is pre-simulated before being rendered.

Returns
Warmup time in seconds

◆ is_playing()

bool godot::PixelpartEffect2D::is_playing ( ) const

Return whether the effect is currently playing or is paused.

Returns
Whether the effect is currently playing or is paused.

◆ is_trigger_activated()

bool godot::PixelpartEffect2D::is_trigger_activated ( String name) const

Return whether trigger name was activated.

Parameters
nameName of the trigger
Returns
true if the trigger was activated

◆ pause()

void godot::PixelpartEffect2D::pause ( )

Pause simulation of the effect.

If paused, the effect is still rendered but freezed in time.

◆ play()

void godot::PixelpartEffect2D::play ( bool state)

Start playing or pause simulation of the effect.

If paused, the effect is still rendered but freezed in time.

Parameters
stateWhether to play or pause the effect.

◆ set_effect()

void godot::PixelpartEffect2D::set_effect ( Ref< PixelpartEffectResource > resource)

Change the effect resource that is shown.

Parameters
resourceEffect resource to show

◆ set_effect_scale()

void godot::PixelpartEffect2D::set_effect_scale ( float scale)

Set multiplier for the size of the effect.

Adjust this value if the effect appears too small or too large in the scene.

Parameters
scaleEffect scale

◆ set_flip_h()

void godot::PixelpartEffect2D::set_flip_h ( bool flip)

Set whether the effect is flipped horizontally.

Parameters
flipFlipped

◆ set_flip_v()

void godot::PixelpartEffect2D::set_flip_v ( bool flip)

Set whether the effect is flipped vertically.

Parameters
flipFlipped

◆ set_frame_rate()

void godot::PixelpartEffect2D::set_frame_rate ( float rate)

Set at which rate the effect is simulated, in frames per second.

Parameters
rateFrame rate, in frames per second

◆ set_input_bool()

void godot::PixelpartEffect2D::set_input_bool ( String name,
bool value )

Set the effect input name to the given value. The effect input must be of type bool.

Parameters
nameName of the effect input
valueNew value

◆ set_input_float()

void godot::PixelpartEffect2D::set_input_float ( String name,
float value )

Set the effect input name to the given value. The effect input must be of type float.

Parameters
nameName of the effect input
valueNew value

◆ set_input_float2()

void godot::PixelpartEffect2D::set_input_float2 ( String name,
Vector2 value )

Set the effect input name to the given value. The effect input must be of type Vector2.

Parameters
nameName of the effect input
valueNew value

◆ set_input_float3()

void godot::PixelpartEffect2D::set_input_float3 ( String name,
Vector3 value )

Set the effect input name to the given value. The effect input must be of type Vector3.

Parameters
nameName of the effect input
valueNew value

◆ set_input_float4()

void godot::PixelpartEffect2D::set_input_float4 ( String name,
Vector4 value )

Set the effect input name to the given value. The effect input must be of type Vector4.

Parameters
nameName of the effect input
valueNew value

◆ set_input_int()

void godot::PixelpartEffect2D::set_input_int ( String name,
int value )

Set the effect input name to the given value. The effect input must be of type int.

Parameters
nameName of the effect input
valueNew value

◆ set_inputs()

void godot::PixelpartEffect2D::set_inputs ( Dictionary inputs)

Set dictionary of effect input values.

Do not use to change effect inputs at runtime, use the set_input methods instead.

Parameters
inputsEffect input values

◆ set_loop()

void godot::PixelpartEffect2D::set_loop ( bool mode)

Set whether the effect restarts automatically after time loop_time.

Parameters
modeLoop mode

◆ set_loop_time()

void godot::PixelpartEffect2D::set_loop_time ( float time)

Set time in seconds after which the effect loops.

Only effective if loop = true.

Parameters
timeLoop time in seconds

◆ set_speed()

void godot::PixelpartEffect2D::set_speed ( float sp)

Set how fast the effect is being played.

Parameters
spSpeed multiplier

◆ set_warmup_time()

void godot::PixelpartEffect2D::set_warmup_time ( float time)

Set time in seconds the effect is pre-simulated before being rendered.

This value impacts performance and should be kept as low as possible.

Parameters
timeWarmup time in seconds

◆ spawn_particles()

void godot::PixelpartEffect2D::spawn_particles ( String particleEmitterName,
String particleTypeName,
int count )

Generate count particles of the given type from the given emitter.

Parameters
particleEmitterNameName of the particle emitter
particleTypeNameName of the particle type
countNumber of particles to generate

Member Data Documentation

◆ effect_scale

float godot::PixelpartEffect2D::effect_scale

Multiplier for the size of the effect.

Adjust this value if the effect appears too small or too large in the scene.

◆ inputs

Dictionary godot::PixelpartEffect2D::inputs

Dictionary of effect input values.

Do not use to change effect inputs at runtime, use the set_input methods instead.

◆ loop_time

float godot::PixelpartEffect2D::loop_time

Time in seconds after which the effect loops.

Only effective if loop = true.

◆ warmup_time

float godot::PixelpartEffect2D::warmup_time

Time in seconds the effect is pre-simulated before being rendered.

This value impacts performance and should be kept as low as possible.


The documentation for this class was generated from the following files: