Particles2D¶
Inherits: Node2D < CanvasItem < Node < Object
GPU-based 2D particle emitter.
Descripción¶
2D particle node used to create a variety of particle systems and effects. Particles2D
features an emitter that generates some number of particles at a given rate.
Use the process_material
property to add a ParticlesMaterial to configure particle appearance and behavior. Alternatively, you can add a ShaderMaterial which will be applied to all particles.
Note: Particles2D
only work when using the GLES3 renderer. If using the GLES2 renderer, use CPUParticles2D instead. You can convert Particles2D
to CPUParticles2D by selecting the node, clicking the Particles menu at the top of the 2D editor viewport then choosing Convert to CPUParticles2D.
Note: After working on a Particles node, remember to update its visibility_rect by selecting it, clicking the Particles menu at the top of the 2D editor viewport then choose Generate Visibility Rect. Otherwise, particles may suddenly disappear depending on the camera position and angle.
Note: Unlike CPUParticles2D, Particles2D
currently ignore the texture region defined in AtlasTextures.
Tutoriales¶
Propiedades¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Métodos¶
capture_rect ( ) const |
|
void |
restart ( ) |
Enumeraciones¶
enum DrawOrder:
DRAW_ORDER_INDEX = 0 --- Las partículas se dibujan en el orden en que se emiten.
DRAW_ORDER_LIFETIME = 1 --- Las partículas se dibujan en orden según el tiempo de vida restante.
Descripciones de Propiedades¶
int amount
Default |
|
Setter |
set_amount(value) |
Getter |
get_amount() |
The number of particles emitted in one emission cycle (corresponding to the lifetime).
Note: Changing amount will reset the particle emission, therefore removing all particles that were already emitted before changing amount.
DrawOrder draw_order
Default |
|
Setter |
set_draw_order(value) |
Getter |
get_draw_order() |
Orden de dibujo de las partículas. Utiliza los valores de DrawOrder.
bool emitting
Default |
|
Setter |
set_emitting(value) |
Getter |
is_emitting() |
Si true
, se están emitiendo partículas.
float explosiveness
Default |
|
Setter |
set_explosiveness_ratio(value) |
Getter |
get_explosiveness_ratio() |
La rapidez con la que se emiten las partículas en un ciclo de emisión. Si es mayor que 0
, habrá una espacio de tiempo en las emisiones antes de que comience el siguiente ciclo.
int fixed_fps
Default |
|
Setter |
set_fixed_fps(value) |
Getter |
get_fixed_fps() |
La velocidad de fotogramas del sistema de partículas está fijada a un valor. Por ejemplo, cambiando el valor a 2 hará que las partículas se rendericen a 2 fotogramas por segundo. Ten en cuenta que esto no ralentiza la simulación del sistema de partículas en sí.
bool fract_delta
Default |
|
Setter |
set_fractional_delta(value) |
Getter |
get_fractional_delta() |
Si true
, resulta en un cálculo delta fraccionario que tiene un efecto de visualización de partículas más suave.
float lifetime
Default |
|
Setter |
set_lifetime(value) |
Getter |
get_lifetime() |
The amount of time each particle will exist (in seconds).
bool local_coords
Default |
|
Setter |
set_use_local_coordinates(value) |
Getter |
get_use_local_coordinates() |
Si true
, las partículas usan el espacio de coordenadas del nodo padre. Si false
, usan las coordenadas globales.
Texture normal_map
Setter |
set_normal_map(value) |
Getter |
get_normal_map() |
Mapa normal para ser usado por la propiedad texture.
Nota: Godot espera que el mapa normal utilice las coordenadas X+, Y-, y Z+. Ver esta página para una comparación de las coordenadas del mapa normal esperadas por los motores más populares.
bool one_shot
Default |
|
Setter |
set_one_shot(value) |
Getter |
get_one_shot() |
Si true
, sólo se produce un ciclo de emisión. Si se establece true
durante un ciclo, la emisión se detendrá al final del ciclo.
float preprocess
Default |
|
Setter |
set_pre_process_time(value) |
Getter |
get_pre_process_time() |
El sistema de partículas se inicia como si ya hubiera funcionado durante este número de segundos.
Material process_material
Setter |
set_process_material(value) |
Getter |
get_process_material() |
Material para procesar partículas. Puede ser un ParticlesMaterial o un ShaderMaterial.
float randomness
Default |
|
Setter |
set_randomness_ratio(value) |
Getter |
get_randomness_ratio() |
Proporción de aleatoriedad de la vida útil de las emisiones.
float speed_scale
Default |
|
Setter |
set_speed_scale(value) |
Getter |
get_speed_scale() |
El sistema de partículas está funcionando a una velocidad de escalada. Un valor de 0
puede ser usado para pausar las partículas.
Texture texture
Setter |
set_texture(value) |
Getter |
get_texture() |
La textura de las partículas. Si null
, las partículas serán cuadradas.
Rect2 visibility_rect
Default |
|
Setter |
set_visibility_rect(value) |
Getter |
get_visibility_rect() |
The Rect2 that determines the node's region which needs to be visible on screen for the particle system to be active.
Grow the rect if particles suddenly appear/disappear when the node enters/exits the screen. The Rect2 can be grown via code or with the Particles → Generate Visibility Rect editor tool.
Descripciones de Métodos¶
Rect2 capture_rect ( ) const
Devuelve un rectángulo que contiene las posiciones de todas las partículas existentes.
void restart ( )
Reinicia todas las partículas existentes.