-
Notifications
You must be signed in to change notification settings - Fork 21
/
AnimFrame.js
48 lines (40 loc) · 1003 Bytes
/
AnimFrame.js
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
/**
* Represents a a single frame in an animation.
* @name AnimationFrame
* @constructor AnimationFrame
* @param {Object} mixin Object containing properties to mixin
*/
class AnimFrame {
constructor(options = {}){
/**
* The ending time in milliseconds of this frame relative to its Animation
* @type {Number}
* @memberOf AnimationFrame#
* @default
*/
this.endTime = 0;
/**
* The horizontal position of the group of frames contained in a single image
* @type {Number}
* @memberOf AnimationFrame#
* @default
*/
this.imgSlotX = 0;
/**
* The vertical position of the group of frames contained in a single image
* @type {Number}
* @memberOf AnimationFrame#
* @default
*/
this.imgSlotY = 0;
/**
* The image to render
* @type {Image}
* @memberOf AnimationFrame#
* @default
*/
this.image = null;
Object.assign(this, options);
}
}
module.exports = AnimFrame;