Skip to content

Commit a4e7987

Browse files
committed
Merge branch 'master' into rendering-cleanup
# Conflicts: # src/gameobjects/blitter/BlitterWebGLRenderer.js
2 parents 31be6fa + bc298ac commit a4e7987

26 files changed

Lines changed: 1153 additions & 693 deletions

.npmignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
11
**/.*
2-
dist/
3-
docs/
4-
merge/
5-
examples/
6-
v3/
2+
wip/

src/CoreScenePlugins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ var CoreScenePlugins = [
1111
'GameObjectCreator',
1212
'GameObjectFactory',
1313
'ScenePlugin',
14-
'DisplayList',
15-
'UpdateList'
14+
'DisplayListPlugin',
15+
'UpdateListPlugin'
1616

1717
];
1818

src/animations/Animation.js

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,78 @@ var Animation = new Class({
1515

1616
initialize:
1717

18+
/**
19+
* [description]
20+
*
21+
* @class Animation
22+
* @memberOf Phaser.Animations
23+
* @constructor
24+
* @since 3.0.0
25+
*
26+
* @param {undefined} manager - [description]
27+
* @param {undefined} key - [description]
28+
* @param {undefined} config - [description]
29+
*/
1830
function Animation (manager, key, config)
1931
{
32+
/**
33+
* [description]
34+
*
35+
* @property {Phaser.Animations.AnimationManager} manager
36+
* @since 3.0.0
37+
*/
2038
this.manager = manager;
2139

40+
/**
41+
* [description]
42+
*
43+
* @property {string} key
44+
*/
2245
this.key = key;
2346

2447
// A frame based animation (as opposed to a bone based animation)
48+
49+
/**
50+
* [description]
51+
*
52+
* @property {string} type
53+
* @default frame
54+
*/
2555
this.type = 'frame';
2656

2757
// Extract all the frame data into the frames array
58+
59+
/**
60+
* [description]
61+
*
62+
* @property {array} frames
63+
*/
2864
this.frames = this.getFrames(
2965
manager.textureManager,
3066
GetValue(config, 'frames', []),
3167
GetValue(config, 'defaultTextureKey', null)
3268
);
3369

3470
// The frame rate of playback in frames per second (default 24 if duration is null)
71+
72+
/**
73+
* [description]
74+
*
75+
* @property {integer} frameRate
76+
* @default 24
77+
* @since 3.0.0
78+
*/
3579
this.frameRate = GetValue(config, 'frameRate', null);
3680

3781
// How long the animation should play for. If frameRate is set it overrides this value
3882
// otherwise frameRate is derived from duration
83+
84+
/**
85+
* [description]
86+
*
87+
* @property {integer} duration
88+
* @since 3.0.0
89+
*/
3990
this.duration = GetValue(config, 'duration', null);
4091

4192
if (this.duration === null && this.frameRate === null)
@@ -60,49 +111,171 @@ var Animation = new Class({
60111
}
61112

62113
// ms per frame (without including frame specific modifiers)
114+
115+
/**
116+
* [description]
117+
*
118+
* @property {integer} msPerFrame
119+
*/
63120
this.msPerFrame = 1000 / this.frameRate;
64121

65122
// Skip frames if the time lags, or always advanced anyway?
123+
124+
/**
125+
* [description]
126+
*
127+
* @property {boolean} skipMissedFrames
128+
* @default false
129+
*/
66130
this.skipMissedFrames = GetValue(config, 'skipMissedFrames', true);
67131

68132
// Delay before starting playback (in seconds)
133+
134+
/**
135+
* [description]
136+
*
137+
* @property {integer} delay
138+
* @default 0
139+
*/
69140
this.delay = GetValue(config, 'delay', 0);
70141

71142
// Number of times to repeat the animation (-1 for infinity)
143+
144+
/**
145+
* [description]
146+
*
147+
* @property {integer} repeat
148+
* @default 0
149+
*/
72150
this.repeat = GetValue(config, 'repeat', 0);
73151

74152
// Delay before the repeat starts (in seconds)
153+
154+
/**
155+
* [description]
156+
*
157+
* @property {integer} repeatDelay
158+
* @default 0
159+
*/
75160
this.repeatDelay = GetValue(config, 'repeatDelay', 0);
76161

77162
// Should the animation yoyo? (reverse back down to the start) before repeating?
163+
164+
/**
165+
* [description]
166+
*
167+
* @property {boolean} yoyo
168+
* @default false
169+
*/
78170
this.yoyo = GetValue(config, 'yoyo', false);
79171

80172
// Should sprite.visible = true when the animation starts to play?
173+
174+
/**
175+
* [description]
176+
*
177+
* @property {boolean} showOnStart
178+
* @default false
179+
*/
81180
this.showOnStart = GetValue(config, 'showOnStart', false);
82181

83182
// Should sprite.visible = false when the animation finishes?
183+
184+
/**
185+
* [description]
186+
*
187+
* @property {boolean} hideOnComplete
188+
* @default false
189+
*/
84190
this.hideOnComplete = GetValue(config, 'hideOnComplete', false);
85191

86192
// Callbacks
193+
194+
/**
195+
* [description]
196+
*
197+
* @property {object} callbackScope
198+
*/
87199
this.callbackScope = GetValue(config, 'callbackScope', this);
88200

201+
202+
/**
203+
* [description]
204+
*
205+
* @property {function} onStart
206+
*/
89207
this.onStart = GetValue(config, 'onStart', false);
208+
209+
/**
210+
* [description]
211+
*
212+
* @property {array} onStartParams
213+
*/
90214
this.onStartParams = GetValue(config, 'onStartParams', []);
91215

216+
217+
/**
218+
* [description]
219+
*
220+
* @property {function} onRepeat
221+
*/
92222
this.onRepeat = GetValue(config, 'onRepeat', false);
223+
224+
/**
225+
* [description]
226+
*
227+
* @property {array} onRepeatParams
228+
*/
93229
this.onRepeatParams = GetValue(config, 'onRepeatParams', []);
94230

95231
// Called for EVERY frame of the animation.
96232
// See AnimationFrame.onUpdate for a frame specific callback.
233+
234+
/**
235+
* [description]
236+
*
237+
* @property {function} onUpdate
238+
*/
97239
this.onUpdate = GetValue(config, 'onUpdate', false);
240+
241+
/**
242+
* [description]
243+
*
244+
* @property {array} onUpdateParams
245+
*/
98246
this.onUpdateParams = GetValue(config, 'onUpdateParams', []);
99247

248+
249+
/**
250+
* [description]
251+
*
252+
* @property {function} onComplete
253+
*/
100254
this.onComplete = GetValue(config, 'onComplete', false);
255+
256+
/**
257+
* [description]
258+
*
259+
* @property {array} onCompleteParams
260+
*/
101261
this.onCompleteParams = GetValue(config, 'onCompleteParams', []);
102262

103263
// Global pause, effects all Game Objects using this Animation instance
264+
265+
/**
266+
* [description]
267+
*
268+
* @property {boolean} paused
269+
* @default false
270+
*/
104271
this.paused = false;
105272

273+
274+
/**
275+
* [description]
276+
*
277+
* @property {null} manager.on('pauseall', this.pause.bind(this))
278+
*/
106279
this.manager.on('pauseall', this.pause.bind(this));
107280
this.manager.on('resumeall', this.resume.bind(this));
108281
},

0 commit comments

Comments
 (0)