Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

7.9 KB
Raw Blame

API surface — esengine/timeline

Symbols: 0 public · 0 beta · 57 experimental · 0 deprecated

ActivationTrack — interface @experimental

childPath: string
name: string
ranges: ActivationRange[]
type: "activation"

ActiveShot — interface @experimental

curve: number
from: number | null
to: number
weight: number

AnimFramesTrack — interface @experimental

childPath: string
frames: AnimFrame[]
name: string
type: "animFrames"

AudioTrack — interface @experimental

childPath: string
events: AudioEvent[]
name: string
type: "audio"

CameraClip — interface @experimental

camera: string
curve: number | undefined
duration: number
start: number

CameraTrack — interface @experimental

childPath: string
clips: CameraClip[]
name: string
type: "camera"

CustomEvent — interface @experimental

name: string
payload: Record<string, unknown>
time: number

CustomEventTrack — interface @experimental

childPath: string
events: CustomEvent[]
name: string
type: "customEvent"

InterpType — type @experimental

(typeof InterpType)[keyof typeof InterpType]

Keyframe — interface @experimental

inTangent: number
interpolation: InterpType | undefined
outTangent: number
time: number
value: number

MAX_SEQUENCE_DEPTH — const @experimental

4

PlayheadRun — interface @experimental

from: number
inclusiveStart: boolean
to: number

PropertyChannel — interface @experimental

keyframes: Keyframe[]
property: string

PropertyTrack — interface @experimental

channels: PropertyChannel[]
childPath: string
component: string
name: string
type: "property"

RootPlacement — interface @experimental

position: Vec3
rotation: Quat

SampleDeps — interface @experimental

getComponent: (name: string) => AnyComponentDef | undefined
resolveChild: (root: Entity, childPath: string) => Entity | null
world: SampleWorld

SampleOptions — interface @experimental

skipChannel: ((childPath: string, component: string, property: string) => boolean) | undefined

SampleWorld — interface @experimental

get: (entity: Entity, def: AnyComponentDef) => Record<string, unknown>
has: (entity: Entity, def: AnyComponentDef) => boolean
set: (entity: Entity, def: AnyComponentDef, data: Record<string, unknown>) => void

SequenceClip — interface @experimental

duration: number
loop: boolean
root: string
speed: number
start: number
timeline: string

SequenceLayer — interface @experimental

asset: TimelineAsset
clip: SequenceClip
key: string
ref: string
root: number
time: number

SequenceLookup — type @experimental

(ref: string) => TimelineAsset | undefined

SequenceTrack — interface @experimental

childPath: string
clips: SequenceClip[]
name: string
type: "sequence"

ShotState — interface @experimental

curve: number
from: string | null
to: string
weight: number

SpineTrack — interface @experimental

blendIn: number
childPath: string
clips: SpineClip[]
name: string
type: "spine"

SpriteAnimTrack — interface @experimental

childPath: string
clip: string
name: string
startTime: number
type: "spriteAnim"

TIMELINE_FORMAT_VERSION — const @experimental

"1.3"

TIMELINE_MOTION — const @experimental

"timeline"

Timeline — const @experimental

ResourceDef<TimelineAPI>

TimelineAPI — class @experimental

@internal clearStates: () => void
@internal ensureState: (entity: Entity, wrapMode: WrapMode, speed: number) => TimelineState
@internal removeState: (entity: Entity) => void
@internal useAssetTimelines: (source: (ref: string) => TimelineAsset | undefined) => void
getAsset: (name: string) => TimelineAsset | undefined
getCurrentTime: (entity: Entity) => number
getState: (entity: Entity) => TimelineState | undefined
isPlaying: (entity: Entity) => boolean
pause: (entity: Entity) => void
play: (entity: Entity) => void
registerAsset: (name: string, asset: TimelineAsset) => void
setTime: (entity: Entity, time: number) => void
stop: (entity: Entity) => void
unregisterAsset: (name: string) => void
static new (flags_?: PlayerFlagChannel | null): TimelineAPI
static prototype: TimelineAPI

TimelineAsset — interface @experimental

duration: number
tracks: Track[]
type: "timeline"
version: string
wrapMode: WrapMode

TimelinePlayer — const @experimental

ComponentDef<TimelinePlayerData>

TimelinePlayerData — interface @experimental

finished: boolean
playing: boolean
speed: number
timeline: string
wrapMode: string

TimelinePlugin — class @experimental

build: (app: App) => void
cleanup: () => void
clearHandles: () => void
name: string
static new (): TimelinePlugin
static prototype: TimelinePlugin

Track — type @experimental

PropertyTrack | SpineTrack | SpriteAnimTrack | ParticleTrack | AudioTrack | ActivationTrack | MarkerTrack | CustomEventTrack | AnimFramesTrack | CameraTrack | SequenceTrack

TrackType — type @experimental

(typeof TrackType)[keyof typeof TrackType]

WrapMode — type @experimental

(typeof WrapMode)[keyof typeof WrapMode]

applyWrapMode — function @experimental

(time: number, duration: number, mode: WrapMode): { time: number; stopped: boolean; }

collectCustomEvents — function @experimental

(asset: TimelineAsset, runs: readonly PlayheadRun[], out: MotionEvent[]): void

collectSequenceLayers — function @experimental

(asset: TimelineAsset, time: number, root: Entity, resolveChild: ChildResolver, lookup: SequenceLookup, chain?: readonly string[], keyPrefix?: string, depth?: number): SequenceLayer[]

createRootPlacement — function @experimental

(): RootPlacement

createTimelineMotionDriver — function @experimental

(timeline: TimelineAPI, effects?: TimelineMotionEffects): MotionDriver<AnimatorClipMotion>

evaluateChannel — function @experimental

(channel: PropertyChannel, time: number): number

isRootPlacementChannel — function @experimental

(childPath: string, component: string, property: string): boolean

parseAnimationClip — function @experimental

(rawJson: unknown): TimelineAsset

parseTimelineAsset — function @experimental

(rawJson: unknown): TimelineAsset

playheadRuns — function @experimental

(from: number, to: number, duration: number, mode: WrapMode, inclusiveStart: boolean): PlayheadRun[]

resolveActiveShot — function @experimental

(asset: TimelineAsset, time: number, root: Entity, resolveChild: ChildResolver, lookup: SequenceLookup): ActiveShot | null

resolveChildEntity — function @experimental

(world: Pick<World, "tryGet">, rootEntity: Entity, childPath: string): Entity | null

resolveShot — function @experimental

(clips: readonly CameraClip[], time: number): ShotState | null

runCrosses — function @experimental

(run: PlayheadRun, at: number): boolean

sampleRootPlacement — function @experimental

(asset: TimelineAsset, time: number, out: RootPlacement): boolean

sampleTimeline — function @experimental

(asset: TimelineAsset, time: number, rootEntity: Entity, deps: SampleDeps, opts?: SampleOptions): void

sampleTimelineInWorld — function @experimental

(asset: TimelineAsset, time: number, world: SampleWorld & Pick<World, "tryGet">, rootEntity: Entity, opts?: SampleOptions): void

serializeTimelineAsset — function @experimental

(asset: TimelineAsset): Record<string, unknown>

serializeTimelineToJson — function @experimental

(asset: TimelineAsset, indent?: number): string

timelinePlugin — const @experimental

TimelinePlugin

wouldNestCycle — function @experimental

(host: string, ref: string, lookup: SequenceLookup): boolean