Skip to content

Commit 2a8447f

Browse files
pixelpicoseanphotonstorm
authored andcommitted
Add some type info to Emitter class.
1 parent deb37e9 commit 2a8447f

1 file changed

Lines changed: 32 additions & 32 deletions

File tree

Phaser/gameobjects/Emitter.ts

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ module Phaser {
1616
/**
1717
* Creates a new <code>Emitter</code> object at a specific position.
1818
* Does NOT automatically generate or attach particles!
19-
*
20-
* @param X The X position of the emitter.
21-
* @param Y The Y position of the emitter.
22-
* @param Size Optional, specifies a maximum capacity for this emitter.
19+
*
20+
* @param X {number} The X position of the emitter.
21+
* @param Y {number} The Y position of the emitter.
22+
* @param Size {number} Optional, specifies a maximum capacity for this emitter.
2323
*/
2424
constructor(game: Game, X: number = 0, Y: number = 0, Size: number = 0) {
2525
super(game, Size);
@@ -165,14 +165,14 @@ module Phaser {
165165

166166
/**
167167
* This function generates a new array of particle sprites to attach to the emitter.
168-
*
169-
* @param Graphics If you opted to not pre-configure an array of Sprite objects, you can simply pass in a particle image or sprite sheet.
170-
* @param Quantity The number of particles to generate when using the "create from image" option.
171-
* @param BakedRotations How many frames of baked rotation to use (boosts performance). Set to zero to not use baked rotations.
172-
* @param Multiple Whether the image in the Graphics param is a single particle or a bunch of particles (if it's a bunch, they need to be square!).
173-
* @param Collide Whether the particles should be flagged as not 'dead' (non-colliding particles are higher performance). 0 means no collisions, 0-1 controls scale of particle's bounding box.
174-
*
175-
* @return This Emitter instance (nice for chaining stuff together, if you're into that).
168+
*
169+
* @param Graphics If you opted to not pre-configure an array of Sprite objects, you can simply pass in a particle image or sprite sheet.
170+
* @param Quantity {number} The number of particles to generate when using the "create from image" option.
171+
* @param BakedRotations {number} How many frames of baked rotation to use (boosts performance). Set to zero to not use baked rotations.
172+
* @param Multiple {boolean} Whether the image in the Graphics param is a single particle or a bunch of particles (if it's a bunch, they need to be square!).
173+
* @param Collide {number} Whether the particles should be flagged as not 'dead' (non-colliding particles are higher performance). 0 means no collisions, 0-1 controls scale of particle's bounding box.
174+
*
175+
* @return This Emitter instance (nice for chaining stuff together, if you're into that).
176176
*/
177177
public makeParticles(Graphics, Quantity: number = 50, BakedRotations: number = 16, Multiple: bool = false, Collide: number = 0): Emitter {
178178

@@ -182,7 +182,7 @@ module Phaser {
182182

183183
/*
184184
if(Multiple)
185-
{
185+
{
186186
var sprite:Sprite = new Sprite(this._game);
187187
sprite.loadGraphic(Graphics,true);
188188
totalFrames = sprite.frames;
@@ -318,11 +318,11 @@ module Phaser {
318318

319319
/**
320320
* Call this function to start emitting particles.
321-
*
322-
* @param Explode Whether the particles should all burst out at once.
323-
* @param Lifespan How long each particle lives once emitted. 0 = forever.
324-
* @param Frequency Ignored if Explode is set to true. Frequency is how often to emit a particle. 0 = never emit, 0.1 = 1 particle every 0.1 seconds, 5 = 1 particle every 5 seconds.
325-
* @param Quantity How many particles to launch. 0 = "all of the particles".
321+
*
322+
* @param Explode {boolean} Whether the particles should all burst out at once.
323+
* @param Lifespan {number} How long each particle lives once emitted. 0 = forever.
324+
* @param Frequency {number} Ignored if Explode is set to true. Frequency is how often to emit a particle. 0 = never emit, 0.1 = 1 particle every 0.1 seconds, 5 = 1 particle every 5 seconds.
325+
* @param Quantity {number} How many particles to launch. 0 = "all of the particles".
326326
*/
327327
public start(Explode: bool = true, Lifespan: number = 0, Frequency: number = 0.1, Quantity: number = 0) {
328328

@@ -395,9 +395,9 @@ module Phaser {
395395

396396
/**
397397
* A more compact way of setting the width and height of the emitter.
398-
*
399-
* @param Width The desired width of the emitter (particles are spawned randomly within these dimensions).
400-
* @param Height The desired height of the emitter.
398+
*
399+
* @param Width {number} The desired width of the emitter (particles are spawned randomly within these dimensions).
400+
* @param Height {number} The desired height of the emitter.
401401
*/
402402
public setSize(Width: number, Height: number) {
403403
this.width = Width;
@@ -406,9 +406,9 @@ module Phaser {
406406

407407
/**
408408
* A more compact way of setting the X velocity range of the emitter.
409-
*
410-
* @param Min The minimum value for this range.
411-
* @param Max The maximum value for this range.
409+
*
410+
* @param Min {number} The minimum value for this range.
411+
* @param Max {number} The maximum value for this range.
412412
*/
413413
public setXSpeed(Min: number = 0, Max: number = 0) {
414414
this.minParticleSpeed.x = Min;
@@ -417,9 +417,9 @@ module Phaser {
417417

418418
/**
419419
* A more compact way of setting the Y velocity range of the emitter.
420-
*
421-
* @param Min The minimum value for this range.
422-
* @param Max The maximum value for this range.
420+
*
421+
* @param Min {number} The minimum value for this range.
422+
* @param Max {number} The maximum value for this range.
423423
*/
424424
public setYSpeed(Min: number = 0, Max: number = 0) {
425425
this.minParticleSpeed.y = Min;
@@ -428,9 +428,9 @@ module Phaser {
428428

429429
/**
430430
* A more compact way of setting the angular velocity constraints of the emitter.
431-
*
432-
* @param Min The minimum value for this range.
433-
* @param Max The maximum value for this range.
431+
*
432+
* @param Min {number} The minimum value for this range.
433+
* @param Max {number} The maximum value for this range.
434434
*/
435435
public setRotation(Min: number = 0, Max: number = 0) {
436436
this.minRotation = Min;
@@ -439,8 +439,8 @@ module Phaser {
439439

440440
/**
441441
* Change the emitter's midpoint to match the midpoint of a <code>Object</code>.
442-
*
443-
* @param Object The <code>Object</code> that you want to sync up with.
442+
*
443+
* @param Object {object} The <code>Object</code> that you want to sync up with.
444444
*/
445445
public at(Object) {
446446
Object.getMidpoint(this._point);

0 commit comments

Comments
 (0)