Skip to content

@modoki/engine / index / TimeManager

Interface: TimeManager ​

Public surface of the timeManager singleton — event anchors and derived reads over the pause-aware engine clock. See the module doc above.

Extends ​

Managers ​

actions? ​

optional actions?: Record<string, UIActionDef | UIActionHandler>

Named UIAction handlers owned by this manager (same shape systems use). Registered on activate, removed on deactivate.

Inherited from ​

ManagerDef.actions


deltaTime ​

readonly deltaTime: number

Current frame delta (seconds), pause- and timeScale-aware.


games? ​

optional games?: string[]

Game scope only: active-game ids to match; omit = every game.

Inherited from ​

ManagerDef.games


name ​

name: string

Inherited from ​

ManagerDef.name


scenes? ​

optional scenes?: string[]

Scene scope only: path substrings to match; omit = every scene.

Inherited from ​

ManagerDef.scenes


scope? ​

optional scope?: ManagerScope

Default 'scene'.

Inherited from ​

ManagerDef.scope


timeSinceGameStart ​

readonly timeSinceGameStart: number

Seconds since the game (session) started, or since the last editor Play.


timeSinceSceneLoad ​

readonly timeSinceSceneLoad: number

Seconds since the current scene finished loading.


dispose()? ​

optional dispose(ctx?): void

ctx carries the world the manager was operating against (on a scene swap this is the OLD world, still alive until just after dispose runs) so a dispose can tear down world-bound state on the correct world. Optional.

Parameters ​

ctx? ​

ManagerContext

Returns ​

void

Inherited from ​

ManagerDef.dispose


init()? ​

optional init(ctx): void | Promise<void>

Parameters ​

ctx ​

ManagerContext

Returns ​

void | Promise<void>

Inherited from ​

ManagerDef.init


mark() ​

mark(name): void

Stamp a named anchor at the current elapsed time.

Parameters ​

name ​

string

Returns ​

void


timeSince() ​

timeSince(name): number

Seconds since a named anchor was stamped (0 if never stamped).

Parameters ​

name ​

string

Returns ​

number

Built with Modoki.