Docs

ScriptContext

Docs Index

Purpose

Script callbacks receive one ScriptContext that composes runtime/resource/input windows with active script node id.

ScriptContext replaces split callback args while still exposing each window explicitly through fields. This keeps signatures short and call sites consistent.

API Source

Functions

delta_time!with_node_mut!texture_load!key_down!

Enums

// not documented yet for this module

Constants

ctx.runctx.resctx.iptctx.id

Types

ScriptContextRuntimeWindowResourceWindowInputWindowNodeID

Usage Pattern

pub struct ScriptContext<'a, RT: RuntimeAPI + ?Sized, RS: ResourceAPI + ?Sized, IP: InputAPI + ?Sized>{    pub run: &'a mut RuntimeWindow<'a, RT>,    pub res: &'a ResourceWindow<'a, RS>,    pub ipt: &'a InputWindow<'a, IP>,    pub id: NodeID,}

Key Details

ctx.run is mutable runtime window for scene/query/signal/script mutation APIs.

ctx.res is read-only resource window for asset/resource operations.

ctx.ipt is read-only input window for keyboard/mouse/gamepad/joycon/player state.

ctx.id is NodeID of node that owns current script instance.