Particles.Emitter
Description: Defines a particle emitter that can emit particles based on various configurations.
Extends: EndGate.Graphics.Graphic2d
Implements: EndGate.IUpdateable
Constructors
Emitter (x, y, emissionFunction)
Creates a new instance of the Emitter object.
x: number
The initial horizontal location of the Emitter.
y: number
The initial vertical location of the Emitter.
emissionFunction: EndGate.Tweening.Functions.ITweeningFunction
The initial EmissionFunction to use for particle control.
Fields
EmissionFunction: EndGate.Tweening.Functions.ITweeningFunction
Gets or sets the EmissionFunction. The EmissionFunction is used to control how emitted particles move once emitted.
EmissionInterval: Particles.Range <EndGate.TimeSpan>
Gets or sets the EmissionInterval. The EmissionInterval is used to control how often particles are emitted.
EmissionDirection: Particles.Range <number>
Gets or sets the EmissionDirection. The EmissionDirection is used to control the angle of particle emissions. This angle value should be in radians.
EmissionOutput: Particles.Range <number>
Gets or sets the EmissionOutput. The EmissionOutput is used to control how many particles should be emitted per emission.
ParticleLifetime: Particles.Range <EndGate.TimeSpan>
Gets or sets the ParticleLifetime. The ParticleLifetime is used to control how long particles live before dying out.
ParticleSpeed: Particles.Range <number>
Gets or sets the ParticleSpeed. The ParticleSpeed is used to control the average speed that emitted particles will move at during their lifetime.
ParticleScale: Particles.Range <number>
Gets or sets the ParticleScale. The ParticleScale is used to control each particles size. Values are percentages of particles base sizes.
ParticleRotation: Particles.Range <number>
Gets or sets the ParticleRotation. The ParticleRotation is used to control the initial rotation of emitted particles.
ParticleRotationSpeed: Particles.Range <number>
Gets or sets the ParticleRotationSpeed. The ParticleRotationSpeed is used to control how quickly emitted particles rotate. Values should indicate X number of radians per second.
ParticleOpacity: Particles.Range <number>
Gets or sets the ParticleOpacity. The ParticleOpacity is used to control emitted particles opacity. Values should be between 0 and 1.
ParticleFadeInDuration: Particles.Range <EndGate.TimeSpan>
Gets or sets the ParticleFadeInDuration. The ParticleFadeInDuration is used to control how long particles take to fade in.
ParticleFadeOutDuration: Particles.Range <EndGate.TimeSpan>
Gets or sets the ParticleFadeOutDuration. The ParticleFadeOutDuration is used to control how long particles take to fade out.
Inherited from: EndGate.Graphics.Graphic2d
ZIndex: number
Gets or sets the ZIndex of the Graphic2d. The ZIndex is used to control draw order. Higher ZIndexes appear above lower ZIndexed graphics.
Visible: boolean
Gets or sets the Visible property. The Visible property determines whether the renderable will be drawn to the game screen.
Position: EndGate.Vector2d
Gets or sets the Position of the Graphic2d. The Position determines where the graphic will be drawn on the screen.
Rotation: number
Gets or sets the Rotation of the Graphic2d..
AbsolutePosition: EndGate.Vector2d
Gets the absolute position of the Graphic2d. This is used to calculate absolute positions when graphic's have parents.
OnDisposed: EndGate.EventHandler1 <Graphic2d>
Gets an event that is triggered when the Graphic2d has been disposed. Functions can be bound or unbound to this event to be executed when the event triggers.
Opacity: number
Gets or sets the current opacity. Value is between 0 and 1.
Methods
IsEmitting()
Determines if the Emitter is emitting particles.
Start()
Starts the Emitter. Update must be called once started to begin auto-emission of particles.
Stop()
Stops the Emitter, no particles will be emitted while stopped.
AddTexture()
Adds a texture to the Emitters texture pool.
RemoveTexture()
Removes the provided texture from the texture pool.
Emit()
Emits particles based on the Emitters configuration. Does not abide by the EmissionInterval. To allow for complex particle manipulation this method can be overridden by derived Emitter classes.
Draw()
Draws the Emitter onto the given context. If this Emitter is part of a scene the Draw function will be called automatically.
Scale()
Scale is not implemented.
Update()
Attempts to emit particles if the configured EmisisonInterval has passed since the last Emission.
GetDrawBounds()
The bounding area that represents where the Emitter will draw.
Clone()
Returns a nearly identical copy of this Emitter. The cloned Emitter will be stopped. If this Emitter belongs to a parent, the cloned Emitter will not. The cloned Emitter will not have the same event bindings as this one does.
Inherited from: EndGate.Graphics.Graphic2d
GetChildren()
Returns the list of children for the current Graphic2d.
AddChild()
Adds a child to the Graphic2d. Children are drawn with relative positions to the parent Graphic2d. Children of a Graphic2d should not be added to the Scene, parent Graphic2d's are responsible for drawing their children.
RemoveChild()
Removes a child from the Graphic2d. Returns a Boolean value indicating whether or not the child was able to be removed.
Dispose()
Triggers the OnDisposed event. If this Graphic2d is used with a Scene2d it will be removed from the scene when disposed.
Examples
There's currently no example available for this page. If you'd like to suggest one send me an containing a description, code, and link to the page for the suggested example. As a thanks I'll associate the code snippet with your name directly below the example if approved.