Skip to content

Rengy Script · Base

Area

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

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

Its own hooks fire only on a node that carries an Area. 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_enter(other: NodeId)

Runs when another area starts overlapping this one.

fn on_exit(other: NodeId)

Runs when another area stops overlapping this one.

fn while_in(other: NodeId, dt: f32)

Runs every step another area is still overlapping this one.

fn on_pointer_enter()

Runs when the pointer comes to rest on this area.

fn on_pointer_exit()

Runs when the pointer leaves this area.

fn on_pointer_press()

Runs when a press that began on this area is released on it: a click.