Skip to content

Rengy Script · Base

Emitter

Write : Emitter after the name to get the hooks below as well as every script's own.

rgs
component Example : Emitter {
    fn on_create() {
    }
}
On this page

Its own hooks fire only on a node that carries a ParticleEmitter. Without one, they are declared and never run.

Hooks

fn on_create() every base

Runs once, on the first step the node exists.

fn on_destroy() every base

Runs once, as destroy or destroy_self removes the node. Nodes under it go with it without hearing it.

fn on_position_change(old_position: Vec2, new_position: Vec2) every base

Runs when the node moves in the world.

fn on_visibility_change(is_visible: bool) every base

Runs when the node is shown or hidden.

fn on_signal() every base

Runs on a step when a signal has reached this node; read it with heard.

fn loop(dt: f32) every base

Runs every simulation step while the node exists.

fn on_particle_enter(at: Vec2)

Runs for each particle of this node's emitter that crosses into its Trigger, if its Report asks for arrivals; at is where the particle was.

fn on_particle_exit(at: Vec2)

Runs for each particle of this node's emitter that crosses out of its Trigger, if its Report asks for departures; at is where the particle was.