graphic-pixi/lib/plugins/AnimationManager.d.ts
2023-12-14 13:07:42 +08:00

49 lines
1.2 KiB
TypeScript

import { IGraphicScene } from '../app';
import { GraphicAnimation, JlGraphic } from '../core';
/**
* 图形动画管理
*/
export declare class AnimationManager {
app: IGraphicScene;
_pause: boolean;
/**
* key - graphic.id
*/
graphicAnimationMap: Map<string, Map<string, GraphicAnimation>>;
constructor(app: IGraphicScene);
private run;
pause(): void;
resume(): void;
destroy(): void;
/**
* 图形对象的所有动画map
* @param graphic
* @returns
*/
animationMap(graphic: JlGraphic): Map<string, GraphicAnimation>;
/**
* 注册图形动画
* @param graphic
* @param animation
*/
registerAnimation(graphic: JlGraphic, animation: GraphicAnimation): void;
/**
* 删除图形动画
* @param graphic
* @param name
*/
unregisterAnimation(graphic: JlGraphic, name: string): void;
/**
* 删除所有图形动画
* @param graphic
*/
unregisterGraphicAnimations(graphic: JlGraphic): void;
/**
* 获取图形指定名称动画
* @param graphic
* @param name
* @returns
*/
animation(graphic: JlGraphic, name: string): GraphicAnimation | undefined;
}