- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
- 243
- 244
- 245
- 246
- 247
- 248
- 249
- 250
- 251
- 252
- 253
- 254
- 255
- 256
- 257
- 258
- 259
- 260
- 261
- 262
- 263
- 264
- 265
- 266
- 267
- 268
- 269
- 270
- 271
- 272
- 273
- 274
- 275
- 276
- 277
- 278
- 279
- 280
- 281
- 282
- 283
- 284
- 285
- 286
- 287
- 288
- 289
- 290
- 291
- 292
- 293
- 294
- 295
- 296
- 297
- 298
- 299
- 300
- 301
- 302
- 303
- 304
- 305
- 306
- 307
- 308
- 309
- 310
- 311
/**
* ParticleEmitterSettings contains the default settings for ParticleEmitter
* @see ParticleEmitter
* @namespace ParticleEmitterSettings
*/
const ParticleEmitterSettings = {
/**
* Width of the particle spawn area.
* @type {number}
* @name width
* @memberof ParticleEmitterSettings
* @default 1
*/
width : 1,
/**
* Height of the particle spawn area
* @public
* @type {number}
* @name height
* @memberof ParticleEmitterSettings
* @default 1
*/
height : 1,
/**
* image used for particles texture
* (by default melonJS will create an white 8x8 texture image)
* @public
* @type {HTMLCanvasElement}
* @name image
* @memberof ParticleEmitterSettings
* @default undefined
* @see ParticleEmitterSettings.textureSize
*/
image : undefined,
/**
* default texture size used for particles if no image is specified
* (by default melonJS will create an white 8x8 texture image)
* @public
* @type {number}
* @name textureSize
* @memberof ParticleEmitterSettings
* @default 8
* @see ParticleEmitterSettings.image
*/
textureSize : 8,
/**
* tint to be applied to particles
* @public
* @type {string}
* @name tint
* @memberof ParticleEmitterSettings
* @default "#fff"
*/
tint : "#fff",
/**
* Total number of particles in the emitter
* @public
* @type {number}
* @name totalParticles
* @default 50
* @memberof ParticleEmitterSettings
*/
totalParticles : 50,
/**
* Start angle for particle launch in Radians
* @public
* @type {number}
* @name angle
* @default Math.PI / 2
* @memberof ParticleEmitterSettings
*/
angle : Math.PI / 2,
/**
* letiation in the start angle for particle launch in Radians.
* @public
* @type {number}
* @name angleVariation
* @default 0
* @memberof ParticleEmitterSettings
*/
angleVariation : 0,
/**
* Minimum time each particle lives once it is emitted in ms.
* @public
* @type {number}
* @name minLife
* @default 1000
* @memberof ParticleEmitterSettings
*/
minLife : 1000,
/**
* Maximum time each particle lives once it is emitted in ms.
* @public
* @type {number}
* @name maxLife
* @default 3000
* @memberof ParticleEmitterSettings
*/
maxLife : 3000,
/**
* Start speed of particles.<br>
* @public
* @type {number}
* @name speed
* @default 2
* @memberof ParticleEmitterSettings
*/
speed : 2,
/**
* letiation in the start speed of particles
* @public
* @type {number}
* @name speedVariation
* @default 1
* @memberof ParticleEmitterSettings
*/
speedVariation : 1,
/**
* Minimum start rotation for particles sprites in Radians
* @public
* @type {number}
* @name minRotation
* @default 0
* @memberof ParticleEmitterSettings
*/
minRotation : 0,
/**
* Maximum start rotation for particles sprites in Radians
* @public
* @type {number}
* @name maxRotation
* @default 0
* @memberof ParticleEmitterSettings
*/
maxRotation : 0,
/**
* Minimum start scale ratio for particles (1 = no scaling)
* @public
* @type {number}
* @name minStartScale
* @default 1
* @memberof ParticleEmitterSettings
*/
minStartScale : 1,
/**
* Maximum start scale ratio for particles (1 = no scaling)
* @public
* @type {number}
* @name maxStartScale
* @default 1
* @memberof ParticleEmitterSettings
*/
maxStartScale : 1,
/**
* Minimum end scale ratio for particles
* @public
* @type {number}
* @name minEndScale
* @default 0
* @memberof ParticleEmitterSettings
*/
minEndScale : 0,
/**
* Maximum end scale ratio for particles
* @public
* @type {number}
* @name maxEndScale
* @default 0
* @memberof ParticleEmitterSettings
*/
maxEndScale : 0,
/**
* Vertical force (Gravity) for each particle
* @public
* @type {number}
* @name gravity
* @default 0
* @memberof ParticleEmitterSettings
* @see game.world.gravity
*/
gravity : 0,
/**
* Horizontal force (like a Wind) for each particle
* @public
* @type {number}
* @name wind
* @default 0
* @memberof ParticleEmitterSettings
*/
wind : 0,
/**
* Update the rotation of particle in accordance the particle trajectory.<br>
* The particle sprite should aim at zero angle (draw from left to right).<br>
* Override the particle minRotation and maxRotation.<br>
* @public
* @type {boolean}
* @name followTrajectory
* @default false
* @memberof ParticleEmitterSettings
*/
followTrajectory : false,
/**
* Enable the Texture Additive by composite operation ("additive" blendMode)
* @public
* @type {boolean}
* @name textureAdditive
* @default false
* @memberof ParticleEmitterSettings
* @see ParticleEmitterSettings.blendMode
*/
textureAdditive : false,
/**
* the blend mode to be applied when rendering particles.
* (note: this will superseed the `textureAdditive` setting if different than "normal")
* @public
* @type {string}
* @name blendMode
* @default normal
* @memberof ParticleEmitterSettings
* @see CanvasRenderer#setBlendMode
* @see WebGLRenderer#setBlendMode
*/
blendMode : "normal",
/**
* Update particles only in the viewport, remove it when out of viewport.
* @public
* @type {boolean}
* @name onlyInViewport
* @default true
* @memberof ParticleEmitterSettings
*/
onlyInViewport : true,
/**
* Render particles in screen space.
* @public
* @type {boolean}
* @name floating
* @default false
* @memberof ParticleEmitterSettings
*/
floating : false,
/**
* Maximum number of particles launched each time in this emitter (used only if emitter is Stream).
* @public
* @type {number}
* @name maxParticles
* @default 10
* @memberof ParticleEmitterSettings
*/
maxParticles : 10,
/**
* How often a particle is emitted in ms (used only if emitter is a Stream).
* @public
* @type {number}
* @name frequency
* @default 100
* @memberof ParticleEmitterSettings
*/
frequency : 100,
/**
* Duration that the emitter releases particles in ms (used only if emitter is Stream).
* After this period, the emitter stop the launch of particles.
* @public
* @type {number}
* @name duration
* @default Infinity
* @memberof ParticleEmitterSettings
*/
duration : Infinity,
/**
* Skip n frames after updating the particle system once.
* This can be used to reduce the performance impact of emitters with many particles.
* @public
* @type {number}
* @name framesToSkip
* @default 0
* @memberof ParticleEmitterSettings
*/
framesToSkip : 0
};
export default ParticleEmitterSettings;