UNPKG

kaplay-atb-plugin

Version:

A KAPLAY plugin to create active time bar!

54 lines (49 loc) 2.17 kB
import { GameObj } from 'kaplay'; import { KAPLAYCtx } from 'kaplay'; import { TimerController } from 'kaplay'; declare function ATB(k: KAPLAYCtx): { /** * Creates an ATB (Active Time Battle) bar. * @param time - Number of seconds for the ATB to fill * @param width - Width of the ATB bar * @param height - Height of the ATB bar * @param pos - Position of the ATB bar in the game world * @param action - Function to call when the ATB bar is filled * @param options - Optional parameters for customizing the ATB bar * @param options.wrapperColor - Color of the wrapper in rgb format (default: [0, 0, 0]) * @param options.barColor - Color of the ATB bar in rgb format (default: [10, 130, 180]) * @param options.radious - A number to set radius for the corners of the ATB bar (default: null) * @param options.outline - A number to set the weight of outline (default : null) * @param options.reverse - If true, the bar will fill in reverse order (default: false) * @param options.stay - If true, the bar will stay on the screen after filling (default: false) * @returns - An object containing the wrapper, bar, and controller for the ATB bar */ createATB(time: number, width: number, height: number, pos: { x: number; y: number; }, action: Function, options?: ATBPOptions): ATBBar; }; export default ATB; export declare interface ATBBar { wrapper: GameObj; bar: GameObj; controller: TimerController; pause: Function; remove: Function; } /** * @param wrapperColor - Optional color for the wrapper of the ATB bar in rgb format * @param barColor - Optional color for the ATB bar in rgb format * @param radious - Optional radius for the corners of the ATB bar * @param outline - If true, the bar will have an outline * @param reverse - If true, the bar will go in reverse order (from right to left) */ declare interface ATBPOptions { wrapperColor?: number[]; barColor?: number[]; radious?: number; outline?: number; reverse?: boolean; stay?: boolean; } export { }