Skip to content

Commit e88c486

Browse files
pixelpicoseanphotonstorm
authored andcommitted
Finish document for AnimationManager, Tile, FrameData, BootScreen, PauseScreen.
1 parent 1052df6 commit e88c486

5 files changed

Lines changed: 45 additions & 42 deletions

File tree

Phaser/AnimationManager.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ module Phaser {
1818

1919
/**
2020
* AnimationManager constructor
21-
*
2221
* Create a new <code>AnimationManager</code>.
2322
*
24-
* @param parent Owner sprite of this manager.
23+
* @param parent {Sprite} Owner sprite of this manager.
2524
*/
2625
constructor(game: Game, parent: Sprite) {
2726

@@ -78,11 +77,11 @@ module Phaser {
7877

7978
/**
8079
* Add a new animation.
81-
* @param name What this animation should be called (e.g. "run").
82-
* @param frames An array of numbers/strings indicating what frames to play in what order (e.g. [1, 2, 3] or ['run0', 'run1', run2]).
83-
* @param frameRate The speed in frames per second that the animation should play at (e.g. 60 fps).
84-
* @param loop Whether or not the animation is looped or just plays once.
85-
* @param useNumericIndex Use number indexes instead of string indexes?
80+
* @param name {string} What this animation should be called (e.g. "run").
81+
* @param frames {any[]} An array of numbers/strings indicating what frames to play in what order (e.g. [1, 2, 3] or ['run0', 'run1', run2]).
82+
* @param frameRate {number} The speed in frames per second that the animation should play at (e.g. 60 fps).
83+
* @param loop {boolean} Whether or not the animation is looped or just plays once.
84+
* @param useNumericIndex {boolean} Use number indexes instead of string indexes?
8685
*/
8786
public add(name: string, frames: any[] = null, frameRate: number = 60, loop: bool = false, useNumericIndex: bool = true) {
8887

@@ -116,6 +115,12 @@ module Phaser {
116115

117116
}
118117

118+
/**
119+
* Check whether the frames is valid.
120+
* @param frames {any[]} Frames to be validated.
121+
* @param useNumericIndex {boolean} Does these frames use number indexes or string indexes?
122+
* @return {boolean} True if they're valid, otherwise return false.
123+
*/
119124
private validateFrames(frames: any[], useNumericIndex: bool): bool {
120125

121126
for (var i = 0; i < frames.length; i++)
@@ -142,9 +147,9 @@ module Phaser {
142147

143148
/**
144149
* Play animation with specific name.
145-
* @param name The string name of the animation you want to play.
146-
* @param frameRate FrameRate you want to specify instead of using default.
147-
* @param loop Whether or not the animation is looped or just plays once.
150+
* @param name {string} The string name of the animation you want to play.
151+
* @param frameRate {number} FrameRate you want to specify instead of using default.
152+
* @param loop {boolean} Whether or not the animation is looped or just plays once.
148153
*/
149154
public play(name: string, frameRate?: number = null, loop?: bool) {
150155

Phaser/system/Tile.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ module Phaser {
1414
* Tile constructor
1515
* Create a new <code>Tile</code>.
1616
*
17-
* @param tilemap the tilemap this tile belongs to.
18-
* @param index The index of this tile type in the core map data.
19-
* @param width Width of the tile.
20-
* @param height Height of the tile.
17+
* @param tilemap {Tilemap} the tilemap this tile belongs to.
18+
* @param index {number} The index of this tile type in the core map data.
19+
* @param width {number} Width of the tile.
20+
* @param height number} Height of the tile.
2121
*/
2222
constructor(game: Game, tilemap: Tilemap, index: number, width: number, height: number) {
2323

@@ -121,10 +121,10 @@ module Phaser {
121121

122122
/**
123123
* Set collision configs.
124-
* @param collision Bit field of flags. (see Tile.allowCollision)
125-
* @param resetCollisions Reset collision flags before set.
126-
* @param separateX Enable seprate at x-axis.
127-
* @param separateY Enable seprate at y-axis.
124+
* @param collision {number} Bit field of flags. (see Tile.allowCollision)
125+
* @param resetCollisions {boolean} Reset collision flags before set.
126+
* @param separateX {boolean} Enable seprate at x-axis.
127+
* @param separateY {boolean} Enable seprate at y-axis.
128128
*/
129129
public setCollision(collision: number, resetCollisions: bool, separateX: bool, separateY: bool) {
130130

Phaser/system/animation/FrameData.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ module Phaser {
3535

3636
/**
3737
* Add a new frame.
38-
* @param frame The frame you want to add.
39-
* @return {Frame=} The frame you just added.
38+
* @param frame {Frame} The frame you want to add.
39+
* @return {Frame} The frame you just added.
4040
*/
4141
public addFrame(frame: Frame): Frame {
4242

@@ -55,8 +55,8 @@ module Phaser {
5555

5656
/**
5757
* Get a frame by its index.
58-
* @param index Index of the frame you want to get.
59-
* @return {Frame=} The frame you want.
58+
* @param index {number} Index of the frame you want to get.
59+
* @return {Frame} The frame you want.
6060
*/
6161
public getFrame(index: number): Frame {
6262

@@ -71,8 +71,8 @@ module Phaser {
7171

7272
/**
7373
* Get a frame by its name.
74-
* @param name Name of the frame you want to get.
75-
* @return {Frame=} The frame you want.
74+
* @param name {string} Name of the frame you want to get.
75+
* @return {Frame} The frame you want.
7676
*/
7777
public getFrameByName(name: string): Frame {
7878

@@ -87,7 +87,7 @@ module Phaser {
8787

8888
/**
8989
* Check whether there's a frame with given name.
90-
* @param name Name of the frame you want to check.
90+
* @param name {string} Name of the frame you want to check.
9191
* @return {boolean} True if frame with given name found, otherwise return false.
9292
*/
9393
public checkFrameName(name: string): bool {
@@ -103,10 +103,10 @@ module Phaser {
103103

104104
/**
105105
* Get ranges of frames in an array.
106-
* @param start Start index of frames you want.
107-
* @param end End index of frames you want.
108-
* @param output Optional, result will be added into this array.
109-
* @return {array} Ranges of specific frames in an array.
106+
* @param start {number} Start index of frames you want.
107+
* @param end {number} End index of frames you want.
108+
* @param output {Frame[]} Optional, result will be added into this array.
109+
* @return {Frame[]} Ranges of specific frames in an array.
110110
*/
111111
public getFrameRange(start: number, end: number, output?: Frame[] = []): Frame[] {
112112

@@ -121,8 +121,8 @@ module Phaser {
121121

122122
/**
123123
* Get all indexes of frames by giving their name.
124-
* @param output Optional, result will be added into this array.
125-
* @return {array} Indexes of specific frames in an array.
124+
* @param output {number[]} Optional, result will be added into this array.
125+
* @return {number[]} Indexes of specific frames in an array.
126126
*/
127127
public getFrameIndexes(output?: number[] = []): number[] {
128128

@@ -139,8 +139,8 @@ module Phaser {
139139

140140
/**
141141
* Get all names of frames by giving their indexes.
142-
* @param output Optional, result will be added into this array.
143-
* @return {array} Names of specific frames in an array.
142+
* @param output {number[]} Optional, result will be added into this array.
143+
* @return {number[]} Names of specific frames in an array.
144144
*/
145145
public getFrameIndexesByName(input: string[]): number[] {
146146

@@ -160,16 +160,16 @@ module Phaser {
160160

161161
/**
162162
* Get all frames in this frame data.
163-
* @return {array} All the frames in an array.
163+
* @return {Frame[]} All the frames in an array.
164164
*/
165165
public getAllFrames(): Frame[] {
166166
return this._frames;
167167
}
168168

169169
/**
170170
* Get All frames with specific ranges.
171-
* @param range Ranges in an array.
172-
* @return All frames in an array.
171+
* @param range {number[]} Ranges in an array.
172+
* @return {Frame[]} All frames in an array.
173173
*/
174174
public getFrames(range: number[]) {
175175

Phaser/system/screens/BootScreen.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ module Phaser {
1212

1313
/**
1414
* BootScreen constructor
15-
*
1615
* Create a new <code>BootScreen</code> with specific width and height.
1716
*
18-
* @param width Screen canvas width.
19-
* @param height Screen canvas height.
17+
* @param width {number} Screen canvas width.
18+
* @param height {number} Screen canvas height.
2019
*/
2120
constructor(game:Game) {
2221

Phaser/system/screens/PauseScreen.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ module Phaser {
1212

1313
/**
1414
* PauseScreen constructor
15-
*
1615
* Create a new <code>PauseScreen</code> with specific width and height.
1716
*
18-
* @param width Screen canvas width.
19-
* @param height Screen canvas height.
17+
* @param width {number} Screen canvas width.
18+
* @param height {number} Screen canvas height.
2019
*/
2120
constructor(game: Game, width: number, height: number) {
2221

0 commit comments

Comments
 (0)