Skip to content

Rengy Script · Base

Node

The default base. A script with no : is on a plain node and gets the hooks every script gets.

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

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.