Skip to content

Search

Documentation

particles2d component

A visual-only 2D emitter at the node: rate, lifetime, speed, direction, spread_degrees and gravity. The live particles are renderer state the simulation…

このページの内容

2d · render · 27 properties · 2D

A visual-only 2D emitter at the node: rate, lifetime, speed, direction, spread_degrees and gravity. The live particles are renderer state the simulation never sees.

In a scene, particles2d is the node key that applies it. A script reaches each property below as a field on node.particles2d: reading one asks the running component, and assigning one leaves the rest alone. The whole table is node.particles2d.get() and node.particles2d.set(table).

Properties

property type default description
angular_speed_degrees float 0 The fastest a particle spins, in degrees a second, counter-clockwise when positive; each takes a speed at random between zero and this
blend_mode enum auto How the surface lands on what is under it: straight alpha, a colour that already carries its alpha, added light, multiplied shade, screen, or opaque. auto is premultiplied for a texture uploaded with premultiply, else alpha One of auto, alpha, premultiplied, add, multiply, screen, opaque.
color color [1,1,1,1] Tint, as channel floats or #rrggbb / #rrggbbaa
color_end color [1,1,1,0] The tint a particle fades to by the end of its life
cull_back_faces bool false Skip a triangle whose back faces the viewer, as a negative scale turns one
direction vec2 [0,1] Which way the particles leave; [0, 1] is straight up
dot_color color [1,1,1,1] The dots' colour
dot_size float 0 Size of a dot drawn on every vertex; zero draws none At least 0.
dot_sizing enum world What dot_size counts: world is world units, which the camera's zoom scales, screen is pixels One of world, screen.
draw_surface bool true Whether the surface draws; off leaves the wireframe and the dots alone
emitting bool true Whether new particles are born; live ones finish either way
explosiveness float 0 How much of a one-shot burst is born at once; the rest is spread over the lifetime Range 0–1.
gravity vec2 [0,-3] Acceleration applied over a particle's life
lifetime float 1 Seconds a particle lives At least 0.05.
material asset · material — The material this draws with; empty takes an inherited material component, else the built-in one
one_shot bool false Emit one burst of rate times lifetime particles and stop; setting emitting false and true again fires another
rate float 20 Particles born per second At least 0.
rotation_degrees float 0 The most a particle is turned at birth, either way, in degrees; each takes a turn at random up to this At least 0.
sheet asset · sprite_sheet — A sprite_sheet whose frames each particle steps through over its life, first to last; its image is drawn when texture is empty
size float 4 Particle size in logical pixels At least 0.5.
size_end float -1 The size a particle grows or shrinks to by the end of its life, in logical pixels; below zero keeps size
speed float 2 Initial speed in world units per second At least 0.
spread_degrees float 30 Half-angle of the emission cone in degrees At least 0.
texture asset · texture — An image, or a texture asset, each particle draws with; empty draws a flat square
wireframe_color color [1,1,1,1] The wireframe's colour
wireframe_sizing enum world What wireframe_width counts: world is world units, which the camera's zoom scales, screen is pixels One of world, screen.
wireframe_width float 0 Width of a line drawn along every triangle edge, not the outline; zero draws none At least 0.

Asset types this component references: material, sprite_sheet, texture.