Skip to content

Commit 4be5a10

Browse files
pixelpicoseanphotonstorm
authored andcommitted
Finish documents for GameObject, World, TweenManager, State, Stage.
1 parent 5cf8b84 commit 4be5a10

5 files changed

Lines changed: 127 additions & 128 deletions

File tree

Phaser/Stage.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ module Phaser {
2020
*
2121
* Create a new <code>Stage</code> with specific width and height.
2222
*
23-
* @param parent ID of parent DOM element.
24-
* @param width Width of the stage.
25-
* @param height Height of the stage.
23+
* @param parent {number} ID of parent DOM element.
24+
* @param width {number} Width of the stage.
25+
* @param height {number} Height of the stage.
2626
*/
2727
constructor(game: Game, parent: string, width: number, height: number) {
2828

Phaser/State.ts

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ module Phaser {
1212

1313
/**
1414
* State constructor
15-
*
1615
* Create a new <code>State</code>.
1716
*/
1817
constructor(game: Game) {
@@ -130,11 +129,11 @@ module Phaser {
130129
/**
131130
* Create a new camera with specific position and size.
132131
*
133-
* @param x X position of the new camera.
134-
* @param y Y position of the new camera.
135-
* @param width Width of the new camera.
136-
* @param height Height of the new camera.
137-
* @returns {Camera=} The newly created camera object.
132+
* @param x {number} X position of the new camera.
133+
* @param y {number} Y position of the new camera.
134+
* @param width {number} Width of the new camera.
135+
* @param height {number} Height of the new camera.
136+
* @returns {Camera} The newly created camera object.
138137
*/
139138
public createCamera(x: number, y: number, width: number, height: number): Camera {
140139
return this.game.world.createCamera(x, y, width, height);
@@ -143,9 +142,9 @@ module Phaser {
143142
/**
144143
* Create a new GeomSprite with specific position.
145144
*
146-
* @param x X position of the new geom sprite.
147-
* @param y Y position of the new geom sprite.
148-
* @returns {GeomSprite=} The newly created geom sprite object.
145+
* @param x {number} X position of the new geom sprite.
146+
* @param y {number} Y position of the new geom sprite.
147+
* @returns {GeomSprite} The newly created geom sprite object.
149148
*/
150149
public createGeomSprite(x: number, y: number): GeomSprite {
151150
return this.world.createGeomSprite(x, y);
@@ -154,10 +153,10 @@ module Phaser {
154153
/**
155154
* Create a new Sprite with specific position and sprite sheet key.
156155
*
157-
* @param x X position of the new sprite.
158-
* @param y Y position of the new sprite.
159-
* @param key Optinal, key for the sprite sheet you want it to use.
160-
* @returns {Sprite=} The newly created sprite object.
156+
* @param x {number} X position of the new sprite.
157+
* @param y {number} Y position of the new sprite.
158+
* @param key {string} Optinal, key for the sprite sheet you want it to use.
159+
* @returns {Sprite} The newly created sprite object.
161160
*/
162161
public createSprite(x: number, y: number, key?: string = ''): Sprite {
163162
return this.game.world.createSprite(x, y, key);
@@ -166,9 +165,9 @@ module Phaser {
166165
/**
167166
* Create a new DynamicTexture with specific size.
168167
*
169-
* @param width Width of the texture.
170-
* @param height Height of the texture.
171-
* @returns {DynamicTexture=} The newly created dynamic texture object.
168+
* @param width {number} Width of the texture.
169+
* @param height {number} Height of the texture.
170+
* @returns {DynamicTexture} The newly created dynamic texture object.
172171
*/
173172
public createDynamicTexture(width: number, height: number): DynamicTexture {
174173
return this.game.world.createDynamicTexture(width, height);
@@ -177,8 +176,8 @@ module Phaser {
177176
/**
178177
* Create a new object container.
179178
*
180-
* @param MaxSize Optinal, capacity of this group.
181-
* @returns {Group=} The newly created group.
179+
* @param MaxSize {number} Optinal, capacity of this group.
180+
* @returns {Group} The newly created group.
182181
*/
183182
public createGroup(MaxSize?: number = 0): Group {
184183
return this.game.world.createGroup(MaxSize);
@@ -187,7 +186,7 @@ module Phaser {
187186
/**
188187
* Create a new Particle.
189188
*
190-
* @return {Particle=} The newly created particle object.
189+
* @return {Particle} The newly created particle object.
191190
*/
192191
public createParticle(): Particle {
193192
return this.game.world.createParticle();
@@ -196,10 +195,10 @@ module Phaser {
196195
/**
197196
* Create a new Emitter.
198197
*
199-
* @param x Optinal, x position of the emitter.
200-
* @param y Optinal, y position of the emitter.
201-
* @param size Optinal, size of this emitter.
202-
* @return {Emitter=} The newly created emitter object.
198+
* @param x {number} Optinal, x position of the emitter.
199+
* @param y {number} Optinal, y position of the emitter.
200+
* @param size {number} Optinal, size of this emitter.
201+
* @return {Emitter} The newly created emitter object.
203202
*/
204203
public createEmitter(x?: number = 0, y?: number = 0, size?: number = 0): Emitter {
205204
return this.game.world.createEmitter(x, y, size);
@@ -208,12 +207,12 @@ module Phaser {
208207
/**
209208
* Create a new ScrollZone object with image key, position and size.
210209
*
211-
* @param key Key to a image you wish this object to use.
212-
* @param x X position of this object.
213-
* @param y Y position of this object.
214-
* @param width Width of this object.
215-
* @param height Heigth of this object.
216-
* @returns {ScrollZone=} The newly created scroll zone object.
210+
* @param key {string} Key to a image you wish this object to use.
211+
* @param x {number} X position of this object.
212+
* @param y {number} Y position of this object.
213+
* @param width {number} Width of this object.
214+
* @param height {number} Heigth of this object.
215+
* @returns {ScrollZone} The newly created scroll zone object.
217216
*/
218217
public createScrollZone(key: string, x?: number = 0, y?: number = 0, width?: number = 0, height?: number = 0): ScrollZone {
219218
return this.game.world.createScrollZone(key, x, y, width, height);
@@ -222,13 +221,13 @@ module Phaser {
222221
/**
223222
* Create a new Tilemap.
224223
*
225-
* @param key Key for tileset image.
226-
* @param mapData Data of this tilemap.
227-
* @param format Format of map data. (Tilemap.FORMAT_CSV or Tilemap.FORMAT_TILED_JSON)
228-
* @param resizeWorld Optinal, resize the world to make same as tilemap?
229-
* @param tileWidth Optinal, width of each tile.
230-
* @param tileHeight Optinal, height of each tile.
231-
* @return {Tilemap=} The newly created tilemap object.
224+
* @param key {string} Key for tileset image.
225+
* @param mapData {string} Data of this tilemap.
226+
* @param format {number} Format of map data. (Tilemap.FORMAT_CSV or Tilemap.FORMAT_TILED_JSON)
227+
* @param resizeWorld {boolean} Optinal, resize the world to make same as tilemap?
228+
* @param tileWidth {number} Optinal, width of each tile.
229+
* @param tileHeight number} Optinal, height of each tile.
230+
* @return {Tilemap} The newly created tilemap object.
232231
*/
233232
public createTilemap(key: string, mapData: string, format: number, resizeWorld: bool = true, tileWidth?: number = 0, tileHeight?: number = 0): Tilemap {
234233
return this.game.world.createTilemap(key, mapData, format, resizeWorld, tileWidth, tileHeight);
@@ -237,8 +236,8 @@ module Phaser {
237236
/**
238237
* Create a tween object for a specific object.
239238
*
240-
* @param obj Object you wish the tween will affect.
241-
* @return {Phaser.Tween=} The newly created tween object.
239+
* @param obj Object you wish the tween will affect.
240+
* @return {Phaser.Tween} The newly created tween object.
242241
*/
243242
public createTween(obj): Tween {
244243
return this.game.tweens.create(obj);

Phaser/TweenManager.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Phaser {
1717

1818
/**
1919
* TweenManager constructor
20-
* @param game A reference to the current Game.
20+
* @param game {Game} A reference to the current Game.
2121
*/
2222
constructor(game: Phaser.Game) {
2323

@@ -37,7 +37,7 @@ module Phaser {
3737

3838
/**
3939
* Get all the tween objects in an array.
40-
* @return {array=} Array with all tween objects.
40+
* @return {Phaser.Tween[]} Array with all tween objects.
4141
*/
4242
public getAll() {
4343

@@ -57,8 +57,8 @@ module Phaser {
5757
/**
5858
* Create a tween object for a specific object.
5959
*
60-
* @param object Object you wish the tween will affect.
61-
* @return {Phaser.Tween=} The newly created tween object.
60+
* @param object {object} Object you wish the tween will affect.
61+
* @return {Phaser.Tween} The newly created tween object.
6262
*/
6363
public create(object): Phaser.Tween {
6464

@@ -69,7 +69,7 @@ module Phaser {
6969
/**
7070
* Add an exist tween object to the manager.
7171
*
72-
* @param tween The tween object you want to add.
72+
* @param tween {Phaser.Tween} The tween object you want to add.
7373
* @return {Phaser.Tween} The tween object you added to the manager.
7474
*/
7575
public add(tween: Phaser.Tween) {
@@ -85,7 +85,7 @@ module Phaser {
8585
/**
8686
* Remove a tween from this manager.
8787
*
88-
* @param tween The tween object you want to remove.
88+
* @param tween {Phaser.Tween} The tween object you want to remove.
8989
*/
9090
public remove(tween: Phaser.Tween) {
9191

Phaser/World.ts

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ module Phaser {
1616
* World constructor
1717
* Create a new <code>World</code> with specific width and height.
1818
*
19-
* @param width Width of the world bound.
20-
* @param height Height of the world bound.
19+
* @param width {number} Width of the world bound.
20+
* @param height {number} Height of the world bound.
2121
*/
2222
constructor(game: Game, width: number, height: number) {
2323

@@ -100,9 +100,9 @@ module Phaser {
100100
* Update size of this world with specific width and height.
101101
* You can choose update camera bounds automatically or not.
102102
*
103-
* @param width New width of the world.
104-
* @param height New height of the world.
105-
* @param updateCameraBounds Optinal, update camera bounds automatically or not. Default to true.
103+
* @param width {number} New width of the world.
104+
* @param height {number} New height of the world.
105+
* @param updateCameraBounds {boolean} Optinal, update camera bounds automatically or not. Default to true.
106106
*/
107107
public setSize(width: number, height: number, updateCameraBounds: bool = true) {
108108

@@ -153,11 +153,11 @@ module Phaser {
153153
/**
154154
* Create a new camera with specific position and size.
155155
*
156-
* @param x X position of the new camera.
157-
* @param y Y position of the new camera.
158-
* @param width Width of the new camera.
159-
* @param height Height of the new camera.
160-
* @returns {Camera=} The newly created camera object.
156+
* @param x {number} X position of the new camera.
157+
* @param y {number} Y position of the new camera.
158+
* @param width {number} Width of the new camera.
159+
* @param height {number} Height of the new camera.
160+
* @returns {Camera} The newly created camera object.
161161
*/
162162
public createCamera(x: number, y: number, width: number, height: number): Camera {
163163
return this.cameras.addCamera(x, y, width, height);
@@ -166,8 +166,8 @@ module Phaser {
166166
/**
167167
* Remove a new camera with its id.
168168
*
169-
* @param id ID of the camera you want to remove.
170-
* @returns {boolean} True if successfully removed the camera, otherwise return false.
169+
* @param id {number} ID of the camera you want to remove.
170+
* @returns {boolean} True if successfully removed the camera, otherwise return false.
171171
*/
172172
public removeCamera(id: number): bool {
173173
return this.cameras.removeCamera(id);
@@ -187,10 +187,10 @@ module Phaser {
187187
/**
188188
* Create a new Sprite with specific position and sprite sheet key.
189189
*
190-
* @param x X position of the new sprite.
191-
* @param y Y position of the new sprite.
192-
* @param key Optinal, key for the sprite sheet you want it to use.
193-
* @returns {Sprite=} The newly created sprite object.
190+
* @param x {number} X position of the new sprite.
191+
* @param y {number} Y position of the new sprite.
192+
* @param key {string} Optinal, key for the sprite sheet you want it to use.
193+
* @returns {Sprite} The newly created sprite object.
194194
*/
195195
public createSprite(x: number, y: number, key?: string = ''): Sprite {
196196
return <Sprite> this.group.add(new Sprite(this._game, x, y, key));
@@ -199,9 +199,9 @@ module Phaser {
199199
/**
200200
* Create a new GeomSprite with specific position.
201201
*
202-
* @param x X position of the new geom sprite.
203-
* @param y Y position of the new geom sprite.
204-
* @returns {GeomSprite=} The newly created geom sprite object.
202+
* @param x {number} X position of the new geom sprite.
203+
* @param y {number} Y position of the new geom sprite.
204+
* @returns {GeomSprite} The newly created geom sprite object.
205205
*/
206206
public createGeomSprite(x: number, y: number): GeomSprite {
207207
return <GeomSprite> this.group.add(new GeomSprite(this._game, x, y));
@@ -210,9 +210,9 @@ module Phaser {
210210
/**
211211
* Create a new DynamicTexture with specific size.
212212
*
213-
* @param width Width of the texture.
214-
* @param height Height of the texture.
215-
* @returns {DynamicTexture=} The newly created dynamic texture object.
213+
* @param width {number} Width of the texture.
214+
* @param height {number} Height of the texture.
215+
* @returns {DynamicTexture} The newly created dynamic texture object.
216216
*/
217217
public createDynamicTexture(width: number, height: number): DynamicTexture {
218218
return new DynamicTexture(this._game, width, height);
@@ -221,8 +221,8 @@ module Phaser {
221221
/**
222222
* Create a new object container.
223223
*
224-
* @param MaxSize Optinal, capacity of this group.
225-
* @returns {Group=} The newly created group.
224+
* @param MaxSize {number} Optinal, capacity of this group.
225+
* @returns {Group} The newly created group.
226226
*/
227227
public createGroup(MaxSize?: number = 0): Group {
228228
return <Group> this.group.add(new Group(this._game, MaxSize));
@@ -231,12 +231,12 @@ module Phaser {
231231
/**
232232
* Create a new ScrollZone object with image key, position and size.
233233
*
234-
* @param key Key to a image you wish this object to use.
235-
* @param x X position of this object.
236-
* @param y Y position of this object.
237-
* @param width Width of this object.
238-
* @param height Heigth of this object.
239-
* @returns {ScrollZone=} The newly created scroll zone object.
234+
* @param key {number} Key to a image you wish this object to use.
235+
* @param x {number} X position of this object.
236+
* @param y {number} Y position of this object.
237+
* @param width {number} Width of this object.
238+
* @param height {number} Heigth of this object.
239+
* @returns {ScrollZone} The newly created scroll zone object.
240240
*/
241241
public createScrollZone(key: string, x?: number = 0, y?: number = 0, width?: number = 0, height?: number = 0): ScrollZone {
242242
return <ScrollZone> this.group.add(new ScrollZone(this._game, key, x, y, width, height));
@@ -245,13 +245,13 @@ module Phaser {
245245
/**
246246
* Create a new Tilemap.
247247
*
248-
* @param key Key for tileset image.
249-
* @param mapData Data of this tilemap.
250-
* @param format Format of map data. (Tilemap.FORMAT_CSV or Tilemap.FORMAT_TILED_JSON)
251-
* @param resizeWorld Optinal, resize the world to make same as tilemap?
252-
* @param tileWidth Optinal, width of each tile.
253-
* @param tileHeight Optinal, height of each tile.
254-
* @return {Tilemap=} The newly created tilemap object.
248+
* @param key {string} Key for tileset image.
249+
* @param mapData {string} Data of this tilemap.
250+
* @param format {number} Format of map data. (Tilemap.FORMAT_CSV or Tilemap.FORMAT_TILED_JSON)
251+
* @param resizeWorld {boolean} Optinal, resize the world to make same as tilemap?
252+
* @param tileWidth {number} Optinal, width of each tile.
253+
* @param tileHeight {number} Optinal, height of each tile.
254+
* @return {Tilemap} The newly created tilemap object.
255255
*/
256256
public createTilemap(key: string, mapData: string, format: number, resizeWorld: bool = true, tileWidth?: number = 0, tileHeight?: number = 0): Tilemap {
257257
return <Tilemap> this.group.add(new Tilemap(this._game, key, mapData, format, resizeWorld, tileWidth, tileHeight));
@@ -260,7 +260,7 @@ module Phaser {
260260
/**
261261
* Create a new Particle.
262262
*
263-
* @return {Particle=} The newly created particle object.
263+
* @return {Particle} The newly created particle object.
264264
*/
265265
public createParticle(): Particle {
266266
return new Particle(this._game);
@@ -269,10 +269,10 @@ module Phaser {
269269
/**
270270
* Create a new Emitter.
271271
*
272-
* @param x Optinal, x position of the emitter.
273-
* @param y Optinal, y position of the emitter.
274-
* @param size Optinal, size of this emitter.
275-
* @return {Emitter=} The newly created emitter object.
272+
* @param x {number} Optinal, x position of the emitter.
273+
* @param y {number} Optinal, y position of the emitter.
274+
* @param size {number} Optinal, size of this emitter.
275+
* @return {Emitter} The newly created emitter object.
276276
*/
277277
public createEmitter(x?: number = 0, y?: number = 0, size?: number = 0): Emitter {
278278
return <Emitter> this.group.add(new Emitter(this._game, x, y, size));

0 commit comments

Comments
 (0)