Skip to content

Commit 60d9133

Browse files
committed
Renamed from Frame to AnimationFrame and moved folder.
1 parent ed4cc55 commit 60d9133

3 files changed

Lines changed: 70 additions & 66 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
var Class = require('../../utils/Class');
2+
3+
// Phaser.Animations.AnimationFrame
4+
5+
var AnimationFrame = new Class({
6+
7+
initialize:
8+
9+
function AnimationFrame (textureKey, textureFrame, index, frame)
10+
{
11+
// The keys into the Texture Manager of the texture + frame this uses
12+
this.textureKey = textureKey;
13+
this.textureFrame = textureFrame;
14+
15+
// The index of this frame within the Animation.frames array
16+
this.index = index;
17+
18+
// Texture Frame
19+
this.frame = frame;
20+
21+
// Read-only
22+
this.isFirst = false;
23+
24+
// Read-only
25+
this.isLast = false;
26+
27+
// The frame that comes before this one in the animation (if any)
28+
// Read-only
29+
this.prevFrame = null;
30+
31+
// The frame that comes after this one in the animation (if any)
32+
// Read-only
33+
this.nextFrame = null;
34+
35+
// Additional time (in ms) this frame should appear for - added onto the msPerFrame
36+
this.duration = 0;
37+
38+
// What % through the animation progress is this frame?
39+
// Read-only
40+
this.progress = 0;
41+
42+
// Callback if this frame gets displayed
43+
this.onUpdate = null;
44+
45+
// When this frame hits, set sprite.visible to this
46+
this.setVisible = false;
47+
48+
this.visible = false;
49+
},
50+
51+
toJSON: function ()
52+
{
53+
return {
54+
key: this.textureKey,
55+
frame: this.textureFrame,
56+
duration: this.duration,
57+
visible: this.visible
58+
};
59+
},
60+
61+
destroy: function ()
62+
{
63+
this.frame = undefined;
64+
this.onUpdate = undefined;
65+
}
66+
67+
});
68+
69+
module.exports = AnimationFrame;

v3/src/animations/frame/inc/Frame.js

Lines changed: 0 additions & 65 deletions
This file was deleted.

v3/src/animations/frame/inc/GetFrames.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var Frame = require('./Frame');
1+
var Frame = require('../AnimationFrame');
22
var GetValue = require('../../../utils/object/GetValue');
33

44
var GetFrames = function (textureManager, frames)

0 commit comments

Comments
 (0)