UNPKG

@nmmty/lazycanvas

Version:

A simple way to interact with @napi-rs/canvas in an advanced way!

45 lines (44 loc) 1.6 kB
import type { IAnimationManager, AnyColorSpace } from "../../types"; export declare class AnimationManager implements IAnimationManager { opts: { frameRate: number; maxColors: number; colorSpace: AnyColorSpace; loop: boolean; transparency: boolean; clear: boolean; }; animated: boolean; debug: boolean; constructor(debug?: boolean); /** * Sets the frame rate of the animation. * @param frameRate {number} - The frame rate of the animation (by default 30). */ setFrameRate(frameRate: number): this; /** * Sets the loop of the animation. * @param loop {boolean} - Whether the animation should loop or not (by default true). */ setLoop(loop: boolean): this; /** * Sets the transparency of the animation. * @param transparency {boolean} - Whether the animation should have transparency or not (by default true). */ setTransparent(transparency: boolean): this; /** * Sets the RGB format of the animation. * @param rgb {ColorSpace} - The RGB format of the animation (by default RGB565). */ setRGBFormat(rgb: AnyColorSpace): this; /** * Sets the maximum colors of the animation. * @param maxColors {number} - The maximum colors of the animation (by default 256). */ setMaxColors(maxColors: number): this; /** * Sets whether the content of previous frames will be cleared. * @param clear {boolean} - Whether the animation should clear or not (by default true). */ setClear(clear: boolean): this; }