-
Notifications
You must be signed in to change notification settings - Fork 2
/
PeachyAnimationObject.d.ts
82 lines (69 loc) · 2.03 KB
/
PeachyAnimationObject.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
export interface PeachyAnimationObject {
" __peachyAnimationObjectBrand": never;
/**
* Switch to a different animation tag.
*
* @param tag the animation tag name to switch to.
*/
setTag(tag: string): void;
/**
* Jump to a particular frame index (1-based indexes) in the current animation.
* @param frame the frame index to jump to.
*/
setFrame(frame: number): void;
/**
* Draw the animation's current frame in a specified location.
*
* @param x the x position.
* @param y the y position.
* @param rot the rotation to draw at. (Default: 0)
* @param sx the x scaling. (Default: 1)
* @param sy the y scaling. (Default: 1)
* @param ox the origin offset x. (Default: 0)
* @param oy the origin offset y. (Default: 0)
*/
draw(x: number, y: number, rot?: number, sx?: number, sy?: number, ox?: number, oy?: number): void;
/**
* Update the animation.
* @param dt frame delta. Should be called from love.update and given the dt.
*/
update(dt: number): void;
/**
* Move to the next frame.
*
* Internal: unless you want to skip frames, this generally will not ever need to be called manually.
*/
nextFrame(): void;
/**
* Check for callbacks
*/
call_onLoop(): void;
/**
* Pauses the animation.
*/
pause(): void;
/**
* Unpauses the animation.
*/
play(): void;
/**
* Stops the animation (pause it then return to first frame or last if specified)
*/
stop(onLast: boolean): void;
/**
* Adds a callback function that will be called when the animation loops
*/
onLoop<T extends any[]>(fn: (this: void, ...args: T) => void, ...vararg: T): void;
/**
* Toggle between playing/paused.
*/
togglePlay(): void;
/**
* Provides width stored in the metadata of a current frame
*/
getWidth(): number;
/**
* Provides height stored in the metadata of a current frame
*/
getHeight(): number;
}