UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

123 lines 2.6 kB
/** * @template T,O */ export class AnimatedObjectEmitter<T, O> { /** * * @type {AnimationTrack} */ animation: AnimationTrack; /** * * @type {Function} */ animationUpdater: Function; /** * * @type {Function} */ objectFactory: Function; /** * * @type {Function} */ objectInitializer: Function; /** * * @type {Function} */ objectFinalizer: Function; /** * * @type {EmitterRecord<T>[]} */ elements: EmitterRecord<T>[]; /** * Maximum number of elements to be displayed simultaneously, beyond this number animation speed dialation starts * @type {number} */ rushThreshold: number; /** * Minimum time that must pass between objects being emitted (in Seconds) * Objects spawned more often than that will be buffered and released at regular intervals * @type {number} */ spawnDelay: number; /** * * @type {number} * @private */ private __spawnTimeBudget; /** * * @type {O[]} * @private */ private __spawnBuffer; on: { spanwed: Signal<any, any, any, any, any, any, any, any>; removed: Signal<any, any, any, any, any, any, any, any>; }; /** * Number of active objects * @type {number} */ liveCount: number; /** * * @param {AnimationTrack} animationTrack * @param {function} updater */ setAnimation(animationTrack: AnimationTrack, updater: Function): void; /** * * @param {function(T)} init */ setInitializer(init: (arg0: T) => any): void; /** * * @param {function(T)} fin */ setFinalizer(fin: (arg0: T) => any): void; /** * @param {O} options */ spawn(options: O): void; spawnImmediate(options: any): EmitterRecord<any>; trySpawnDeferred(): void; /** * * @param {T} object */ remove(object: T): boolean; /** * * @param {number} timeDelta */ tick(timeDelta: number): void; } /** * @template T */ declare class EmitterRecord<T> { /** * * @param {T} object */ constructor(object: T); /** * * @type {T} */ object: T; /** * * @type {AnimationTrackPlayback} */ playback: AnimationTrackPlayback; } import Signal from "../../../core/events/signal/Signal.js"; import AnimationTrackPlayback from "../../animation/keyed2/AnimationTrackPlayback.js"; export {}; //# sourceMappingURL=AnimatedObjectEmitter.d.ts.map