Runtime Docs

Time Runtime API

Runtime Index

Purpose

Time helpers expose frame delta and fixed-step timing for scripts.

Time Runtime API explains behavior, constraints, and practical usage so implementation decisions stay consistent across scripts and scenes.

API Source

Functions

delta_time!fixed_delta_time!elapsed_time!time_scale!

Enums

// not documented yet for this module

Constants

target fixed update from project.toml

Types

RuntimeWindowScriptContext

Usage Pattern

let dt = delta_time!(ctx.run);with_node_mut!(ctx.run, Node2D, ctx.id, |node| {    node.position.x += 220.0 * dt;});

Key Details

Use delta time in on_update for frame-rate independent motion.

Use fixed timing with on_fixed_update for deterministic physics-style work.

Store time values before entering ctx.run borrow closures.

Project fixed update target comes from project.toml runtime settings.