import { IAnimatedDisplayObject2dComponent, PlayAnimation2dOptions } from '@gg-web-engine/core'; import { AnimatedSprite } from 'pixi.js'; import { PixiDisplayObjectComponent } from './pixi-display-object.component'; import { PixiVisualTypeDocRepo2D } from '../types'; /** One named clip's frames plus its own playback speed - see `PixiFactory.createAnimatedSprite`. */ export type PixiAnimationClip = { frames: AnimatedSprite['textures']; /** Playback speed, in frames per second. Default 10. */ fps?: number; }; /** * A pixi.js `AnimatedSprite`-backed display object carrying a named set of atlas-frame clips (e.g. * `idle`/`walk`/`run`/`jump`) - the 2D counterpart of an animated glTF mesh on the 3D side. Built by * `PixiFactory.createAnimatedSprite`, never constructed directly. * * `AnimatedSprite.autoUpdate` is always `false` here - this engine drives every tick itself (see * `updateAnimations`), so the sprite is never connected to pixi's own shared `Ticker`. `Ticker.deltaTime` * is the only field `AnimatedSprite.update` actually reads, so `updateAnimations(deltaSeconds)` * synthesizes a throwaway object with just that field (`deltaSeconds * 60`, matching `deltaTime`'s own * "1 == one frame at a 60fps baseline" convention) rather than constructing a real `Ticker`. */ export declare class PixiAnimatedSpriteComponent extends PixiDisplayObjectComponent implements IAnimatedDisplayObject2dComponent { private readonly clips; readonly animationNames: string[]; private _currentAnimationName; get currentAnimationName(): string | null; private get animatedSprite(); constructor(sprite: AnimatedSprite, clips: Record); playAnimation(name: string, options?: PlayAnimation2dOptions): void; stopAnimation(): void; updateAnimations(deltaSeconds: number): void; clone(): PixiAnimatedSpriteComponent; }