You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/gameobjects/Particle.js
+52-6Lines changed: 52 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -7,26 +7,54 @@
7
7
/**
8
8
* @class Phaser.Particle
9
9
*
10
-
* @classdesc Create a new `Particle` object. Particles are extended Sprites that are emitted by a particle emitter.
10
+
* @classdesc Create a new `Particle` object. Particles are extended Sprites that are emitted by a particle emitter such as Phaser.Particles.Arcade.Emitter.
11
11
*
12
12
* @constructor
13
13
* @extends Phaser.Sprite
14
14
* @param {Phaser.Game} game - A reference to the currently running game.
15
-
* @param {number} x - The x coordinate (in world space) to position the Sprite at.
16
-
* @param {number} y - The y coordinate (in world space) to position the Sprite at.
17
-
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
18
-
* @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
15
+
* @param {number} x - The x coordinate (in world space) to position the Particle at.
16
+
* @param {number} y - The y coordinate (in world space) to position the Particle at.
17
+
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the Particle during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
18
+
* @param {string|number} frame - If this Particle is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
19
19
*/
20
20
Phaser.Particle=function(game,x,y,key,frame){
21
21
22
22
Phaser.Sprite.call(this,game,x,y,key,frame);
23
23
24
+
/**
25
+
* @property {boolean} autoScale - If this Particle automatically scales this is set to true by Particle.setScaleData.
26
+
* @protected
27
+
*/
24
28
this.autoScale=false;
29
+
30
+
/**
31
+
* @property {array} scaleData - A reference to the scaleData array owned by the Emitter that emitted this Particle.
32
+
* @protected
33
+
*/
25
34
this.scaleData=null;
35
+
36
+
/**
37
+
* @property {number} _s - Internal cache var for tracking auto scale.
38
+
* @private
39
+
*/
26
40
this._s=0;
27
41
42
+
/**
43
+
* @property {boolean} autoAlpha - If this Particle automatically changes alpha this is set to true by Particle.setAlphaData.
44
+
* @protected
45
+
*/
28
46
this.autoAlpha=false;
47
+
48
+
/**
49
+
* @property {array} alphaData - A reference to the alphaData array owned by the Emitter that emitted this Particle.
50
+
* @protected
51
+
*/
29
52
this.alphaData=null;
53
+
54
+
/**
55
+
* @property {number} _a - Internal cache var for tracking auto alpha.
0 commit comments