XNACS1Lib: CSS490 Spring 2011
The XNACS1ParticleEmitter type exposes the following members.
Constructors
Name | Description | |
---|---|---|
XNACS1ParticleEmitter |
Constructs a particle Emitter.
|
Methods
Name | Description | |
---|---|---|
Above |
Returns if the center of this primitive is "above" (in y) in relation to the center of otherPrimitive.
(Inherited from XNACS1Primitive.) |
|
AddEmitterToUpdateSet |
Adds the emitter to the emitter update list. This will cause the emitter's
UpdateEmitter function to be called once per tick and it to emit particles as
defined.
Newly created emitters are automatically in the update set.
|
|
AddToAutoDrawSet |
Add this primitive to the AutoDrawSet. If this primitive already exists in the draw set,
this function call is ignored. By default, all primitive are added into the AutoDrawSet.
(Inherited from XNACS1Primitive.) |
|
Below |
Returns if the center of this primitive is "below" (in y) in relation to the center of otherPrimitive.
(Inherited from XNACS1Primitive.) |
|
Collided(XNACS1Primitive) |
Determines if this primitive collides with otherPrimitive.
(Inherited from XNACS1Primitive.) |
|
Collided(XNACS1Primitive, Vector2) |
Determines if this primitive collides with the otherPrimitive. If true, pos is the colliding position.
(Inherited from XNACS1Primitive.) |
|
Draw |
If visible, draws the primitive with the associated text label.
(Inherited from XNACS1Primitive.) |
|
DrawPrimitive |
Draws all the particles in the emitter
(Overrides XNACS1Particle..::..DrawPrimitive()()()().) |
|
Emit |
When this method is called a new particle will be added to the emitter set and NewParticle() will be called to change the
initial parameters of the particle if needed.
|
|
HasNonZeroVelocity |
Retruns if the current velocity is non-zero.
(Inherited from XNACS1Primitive.) |
|
IsInAutoDrawSet |
Determines if this primitive is in the AutoDrawSet.
(Inherited from XNACS1Primitive.) |
|
KillParticle(Int32) |
Removes a particle from the emitter list.
|
|
KillParticle(XNACS1Particle) |
Removes a particle from the emitter list.
|
|
LeftOf |
Returns if the center of this primitive is "to the left" (in x) in relation to the center of otherPrimtive
(Inherited from XNACS1Primitive.) |
|
NewParticle |
This method is called by the Emit method whenever a particle is created. By default
particles are created at the Center location of the emitter with InitialLife, InitialSize, DefaultTexture, and DefaultColor.
Newly created particles also have shouldtravel set to false and velocity = 0.
By overloading this method you can change these properties to make particles emit in different ways.
Particle that has just been created and added to the set.
|
|
RemoveEmitterFromUpdateSet |
Removes the emitter from the emitter update list.
To be called before removing all references to the emitter so that
garbage collection can collect it.
|
|
RemoveFromAutoDrawSet |
Remove this primitive from the AutoDrawSet. After this function call, this primitive will not
be drawn in the application window.
(Inherited from XNACS1Primitive.) |
|
RightOf |
Returns if the center of this primitive is "to the right" (in x) in relation to the center of otherPrimitive
(Inherited from XNACS1Primitive.) |
|
SetTextureSpriteAnimationFrames |
Sets animation parameters for a sprite sheet primitive.
Zero-based first frame column for the beginning sprite in the animation sequence.Zero-based first frame row for the beginning sprite in the animation sequence.Zero-based first frame column for the ending sprite in the animation sequence.Zero-based first frame row for the ending sprite in the animation sequence.How many ticks the animation will pause for on each frame.The behavior of the animation loop. (Inherited from XNACS1Primitive.) |
|
SetTextureSpriteSheet |
Defines a texture specified for a primitive to behave like a sprite sheet with the specified number of sprites.
The default sprite to be drawn is the top left sprite in the sheet.
Example: The texture for a given primitive has 16 sprites in it, arranged in a 4 by 4 pattern. By default, all 16 sprites will be displayed, stretched to fit the primitive.
Calling this method allows you to specify the number of sprites in the texture.
The texture of the sprite sheet to be used.The number of columns in the sprite sheet (number of sprites in a single row). Number of rows in the sprite sheet. The padding between sprites and on the top and left edge. (Inherited from XNACS1Primitive.) |
|
TopOfAutoDrawSet |
Make sure this primitive is drawn on top of all other primitives.
(Inherited from XNACS1Primitive.) |
|
TravelPrimitive |
Overloaded TravelPrimitive for Particles.
Moves the particle during each update cycle. This function is automacially called for all visible
particle. Default behavior is to move the particle if:
. Primitive is visible (invivislble primitive is not updated)
. ShouldTravel is true
. HasNonZeroVelocity() is true
This method moves the particle in the direction of its velocity and also displaces it according to the ParticleTravelMode chosen.
(Inherited from XNACS1Particle.) |
|
Update |
Controls updates for AttachedPrimitive, AutoRemoveDead, and AutoEmit.
Overload at your own risk!
|
|
UpdateParticle |
This is where you define the behavior of particles in the emitter. This method
will be called once a tick for each particle if the emitter is in the Emitter
Update Set.
This is an abstract method and must be overloaded.
|
Properties
Name | Description | |
---|---|---|
AttachedPrimitive |
Gets or Sets the primitive that this emitter is attached to.
The emitter's center will be automatically updated each tick to match
the attached primitive's center.
|
|
AutoEmitEnabled |
Gets or Sets whether or not particles should automatically be emitted every EmitFrequency ticks.
|
|
AutoRemoveDeadParticles |
Gets or sets whether or not particles with zero life remaining will be automatically
deleted from the particle emitter set.
Setting a particle's life to negative will ensure it is never deleted via this functionality.
|
|
Center |
Center of the primitive.
(Inherited from XNACS1Particle.) |
|
CenterX |
X coordinate of the center position of the primitive.
(Inherited from XNACS1Primitive.) |
|
CenterY |
Y coordinate of the center position of the primitive.
(Inherited from XNACS1Primitive.) |
|
Color |
Color of the primitive. (undefined for PrimitiveSet).
(Inherited from XNACS1Primitive.) |
|
CurrentSpriteSheetFrameX |
Gets or Sets the zero-based current sprite column for sprite sheet drawing.
(Inherited from XNACS1Primitive.) |
|
CurrentSpriteSheetFrameY |
Gets or Sets the zero-based current sprite row for sprite sheet drawing.
(Inherited from XNACS1Primitive.) |
|
DefaultColor |
Gets or Sets The default color of emitted particles.
|
|
DefaultTexture |
Gets or Sets The default texture of emitted particles.
|
|
DisplacementAmplitude |
The amplitude of the Particle TravelMode displacement. For example, the amplitude of the Sine Wave.
(Inherited from XNACS1Particle.) |
|
DisplacementFrequency |
The frequency of the Particle TravelMode displacement. The default is 1, values between 0..1 would stretch a sine wave while values >1 would compress it.
(Inherited from XNACS1Particle.) |
|
EmitFrequency |
Gets or Sets how many ticks between calls of EmitParticle if AutoEmitEnable = True.
|
|
FrontDirection |
Sets the front direction of the primitive. Setting FrontDireciton will cause the RotateAngle and NormalDirection of the primitive to be updated
accordingly. y default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction].
E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or
rotated 90-degress in the anit-clockwise direction
(Inherited from XNACS1Primitive.) |
|
InitialLife |
Gets or Sets the default life in ticks for emitted particles.
|
|
InitialSize |
Gets or Sets The default size of emitted particles.
|
|
Label |
Annotated text label to be associated with the primitive.
(Inherited from XNACS1Primitive.) |
|
LabelColor |
Color of the anontated text label.
(Inherited from XNACS1Primitive.) |
|
Life |
Gets or sets the life parameter of a particle.
(Inherited from XNACS1Particle.) |
|
MaxBound |
Upper left corner of the primitive.
(Inherited from XNACS1Primitive.) |
|
MinBound |
Lower left corner of the Primitive.
(Inherited from XNACS1Primitive.) |
|
NormalDirection |
Get or Set the normal direction of the primitive. Setting NormalDirection will update RotateAngle and FrontDirection accordingly.
(Inherited from XNACS1Primitive.) |
|
ParticlesPerEmit |
Gets or Sets the number of particles to be emitted per emit cycle if AutoEmitEnabled = true.
|
|
Radius |
Radius of the circle.
(Inherited from XNACS1Circle.) |
|
RotateAngle |
Rotate the primitive by the Angle specified (in degree). After the rotation, the FrontDirection of the primitive
will be udpated accordingly. By default, when RotateAngle is 0, FrontDireciton points towards (1,0) [positive X-direction].
E.g., if we set RotateAngle to 90-degrees, FrontDireciton will be updated accordinlgy to (0,1) [positive y-direciton], or
rotated 90-degress in the anit-clockwise direction
(Inherited from XNACS1Primitive.) |
|
ShouldTravel |
Defines if the primitive should move by its current velocity. Defaults to false.
(Inherited from XNACS1Particle.) |
|
Size |
Get/Set width/height of the primitive.
(Inherited from XNACS1Primitive.) |
|
SizeX |
Width of the primitive.
(Inherited from XNACS1Primitive.) |
|
SizeY |
Height of the primitive. For PrimitiveCircle (diameter), PrimitiveRectangle (height), PrimitiveSet (undefined).
(Inherited from XNACS1Primitive.) |
|
Speed |
Get/Set the speed (magnitude of the Velocity vector) for the velocity.
(Inherited from XNACS1Primitive.) |
|
Texture |
Texture file name (without the "." or the extension) to cover the primitive.
(Inherited from XNACS1Primitive.) |
|
TextureTintColor |
If a primitive has a texture assigned, this will change the tint and or opacity
of the texture when drawn, Color.White is no tint or opacity.
(Inherited from XNACS1Primitive.) |
|
TravelMode |
Gets or Sets the primitive's TravelMode if ShouldTravel = True.
Used in conjunction with DisplacementAmplitude and DisplacementFrequecy.
(Inherited from XNACS1Particle.) |
|
UseSpriteSheet |
Allow the primitive to draw as a sprite sheet.
(Inherited from XNACS1Primitive.) |
|
UseSpriteSheetAnimation |
Allow the primitive to follow a specified sprite sheet animation sequence.
(Inherited from XNACS1Primitive.) |
|
Velocity |
Velocity of a primitive. This is a true velocity: with magnitude (speed) and direction for tavel.
(Inherited from XNACS1Primitive.) |
|
VelocityDirection |
Get/Set the direction of the velocity.
(Inherited from XNACS1Primitive.) |
|
VelocityX |
Get/Set the x-component of the primitive velocity.
(Inherited from XNACS1Primitive.) |
|
VelocityY |
Get/Set the y-component of the primitive velocity.
(Inherited from XNACS1Primitive.) |
|
Visible |
Whether the primitive is visible.
(Inherited from XNACS1Primitive.) |