@@ -15,27 +15,77 @@ var Animation = new Class({
1515
1616 initialize :
1717
18+ /**
19+ * [description]
20+ *
21+ * @class Animation
22+ * @memberOf Phaser.Animations.Animation
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+ /**
34+ * [description]
35+ *
36+ * @property {Phaser.Animations.AnimationManager } manager
37+ */
2038 this . manager = manager ;
2139
40+
41+ /**
42+ * [description]
43+ *
44+ * @property {string } key
45+ */
2246 this . key = key ;
2347
2448 // A frame based animation (as opposed to a bone based animation)
49+
50+ /**
51+ * [description]
52+ *
53+ * @property {string } type
54+ * @default frame
55+ */
2556 this . type = 'frame' ;
2657
2758 // Extract all the frame data into the frames array
59+
60+ /**
61+ * [description]
62+ *
63+ * @property {array } frames
64+ */
2865 this . frames = this . getFrames (
2966 manager . textureManager ,
3067 GetValue ( config , 'frames' , [ ] ) ,
3168 GetValue ( config , 'defaultTextureKey' , null )
3269 ) ;
3370
3471 // The frame rate of playback in frames per second (default 24 if duration is null)
72+
73+ /**
74+ * [description]
75+ *
76+ * @property {integer } frameRate
77+ * @default 24
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+ */
3989 this . duration = GetValue ( config , 'duration' , null ) ;
4090
4191 if ( this . duration === null && this . frameRate === null )
@@ -60,49 +110,171 @@ var Animation = new Class({
60110 }
61111
62112 // ms per frame (without including frame specific modifiers)
113+
114+ /**
115+ * [description]
116+ *
117+ * @property {integer } msPerFrame
118+ */
63119 this . msPerFrame = 1000 / this . frameRate ;
64120
65121 // Skip frames if the time lags, or always advanced anyway?
122+
123+ /**
124+ * [description]
125+ *
126+ * @property {boolean } skipMissedFrames
127+ * @default false
128+ */
66129 this . skipMissedFrames = GetValue ( config , 'skipMissedFrames' , true ) ;
67130
68131 // Delay before starting playback (in seconds)
132+
133+ /**
134+ * [description]
135+ *
136+ * @property {integer } delay
137+ * @default 0
138+ */
69139 this . delay = GetValue ( config , 'delay' , 0 ) ;
70140
71141 // Number of times to repeat the animation (-1 for infinity)
142+
143+ /**
144+ * [description]
145+ *
146+ * @property {integer } repeat
147+ * @default 0
148+ */
72149 this . repeat = GetValue ( config , 'repeat' , 0 ) ;
73150
74151 // Delay before the repeat starts (in seconds)
152+
153+ /**
154+ * [description]
155+ *
156+ * @property {integer } repeatDelay
157+ * @default 0
158+ */
75159 this . repeatDelay = GetValue ( config , 'repeatDelay' , 0 ) ;
76160
77161 // Should the animation yoyo? (reverse back down to the start) before repeating?
162+
163+ /**
164+ * [description]
165+ *
166+ * @property {boolean } yoyo
167+ * @default false
168+ */
78169 this . yoyo = GetValue ( config , 'yoyo' , false ) ;
79170
80171 // Should sprite.visible = true when the animation starts to play?
172+
173+ /**
174+ * [description]
175+ *
176+ * @property {boolean } showOnStart
177+ * @default false
178+ */
81179 this . showOnStart = GetValue ( config , 'showOnStart' , false ) ;
82180
83181 // Should sprite.visible = false when the animation finishes?
182+
183+ /**
184+ * [description]
185+ *
186+ * @property {boolean } hideOnComplete
187+ * @default false
188+ */
84189 this . hideOnComplete = GetValue ( config , 'hideOnComplete' , false ) ;
85190
86191 // Callbacks
192+
193+ /**
194+ * [description]
195+ *
196+ * @property {object } callbackScope
197+ */
87198 this . callbackScope = GetValue ( config , 'callbackScope' , this ) ;
88199
200+
201+ /**
202+ * [description]
203+ *
204+ * @property {function } onStart
205+ */
89206 this . onStart = GetValue ( config , 'onStart' , false ) ;
207+
208+ /**
209+ * [description]
210+ *
211+ * @property {array } onStartParams
212+ */
90213 this . onStartParams = GetValue ( config , 'onStartParams' , [ ] ) ;
91214
215+
216+ /**
217+ * [description]
218+ *
219+ * @property {function } onRepeat
220+ */
92221 this . onRepeat = GetValue ( config , 'onRepeat' , false ) ;
222+
223+ /**
224+ * [description]
225+ *
226+ * @property {array } onRepeatParams
227+ */
93228 this . onRepeatParams = GetValue ( config , 'onRepeatParams' , [ ] ) ;
94229
95230 // Called for EVERY frame of the animation.
96231 // See AnimationFrame.onUpdate for a frame specific callback.
232+
233+ /**
234+ * [description]
235+ *
236+ * @property {function } onUpdate
237+ */
97238 this . onUpdate = GetValue ( config , 'onUpdate' , false ) ;
239+
240+ /**
241+ * [description]
242+ *
243+ * @property {array } onUpdateParams
244+ */
98245 this . onUpdateParams = GetValue ( config , 'onUpdateParams' , [ ] ) ;
99246
247+
248+ /**
249+ * [description]
250+ *
251+ * @property {function } onComplete
252+ */
100253 this . onComplete = GetValue ( config , 'onComplete' , false ) ;
254+
255+ /**
256+ * [description]
257+ *
258+ * @property {array } onCompleteParams
259+ */
101260 this . onCompleteParams = GetValue ( config , 'onCompleteParams' , [ ] ) ;
102261
103262 // Global pause, effects all Game Objects using this Animation instance
263+
264+ /**
265+ * [description]
266+ *
267+ * @property {boolean } paused
268+ * @default false
269+ */
104270 this . paused = false ;
105271
272+
273+ /**
274+ * [description]
275+ *
276+ * @property {null } manager.on('pauseall', this.pause.bind(this))
277+ */
106278 this . manager . on ( 'pauseall' , this . pause . bind ( this ) ) ;
107279 this . manager . on ( 'resumeall' , this . resume . bind ( this ) ) ;
108280 } ,
0 commit comments