Skip to main content

CameraAction

@zylem/game-lib


@zylem/game-lib / core / CameraAction

Interface: CameraAction

Defined in: packages/game-lib/src/lib/camera/types.ts:93

Actions are transient effects that apply additive deltas (screenshake, recoil, etc.). They self-expire when isDone() returns true and are automatically removed.

Properties​

priority?​

optional priority?: number

Defined in: packages/game-lib/src/lib/camera/types.ts:99

Sort order for action application. Default 0.

Methods​

isDone()​

isDone(ctx): boolean

Defined in: packages/game-lib/src/lib/camera/types.ts:97

Return true when the action has completed and should be removed.

Parameters​

ctx​

CameraContext

Returns​

boolean


update()​

update(ctx): PoseDelta

Defined in: packages/game-lib/src/lib/camera/types.ts:95

Return the additive delta for this frame.

Parameters​

ctx​

CameraContext

Returns​

PoseDelta