C# Class Project290.Particles.ParticleContainer

Used for storing a large number of Particles. This efficiently handles storing and updating them.
Afficher le fichier Open project: scastle/Solitude Class Usage Examples

Méthodes publiques

Méthode Description
Add ( float xPosition, float yPosition, float xVelocity, float yVelocity, Color color, float scale, float rotation, byte actionUniqueIdentifier, ParticleAction action ) : bool

Adds a Particle.

Add ( float xPosition, float yPosition, float xVelocity, float yVelocity, Color color, float scale, float rotation, float rotationSpeed, byte actionUniqueIdentifier, ParticleAction action ) : bool

Adds a Particle.

ApplyAcceloration ( Vector2 &acceloration ) : void

Applies the acceloration to all particles.

Draw ( ) : void

Draws this instance.

ParticleContainer ( int maxParticles ) : System

Initializes a new instance of the ParticleContainer class.

Reset ( ) : void

Resets this instance.

Update ( ) : void

Updates this instance.

Private Methods

Méthode Description
CheckToSeeIfGameClockReset ( ) : void

Checks to see if game clock reset.

Method Details

Add() public méthode

Adds a Particle.
public Add ( float xPosition, float yPosition, float xVelocity, float yVelocity, Color color, float scale, float rotation, byte actionUniqueIdentifier, ParticleAction action ) : bool
xPosition float The x position.
yPosition float The y position.
xVelocity float The x velocity.
yVelocity float The y velocity.
color Color The color to overlay the drawn image with.
scale float The scale.
rotation float The rotation.
actionUniqueIdentifier byte This is used to identify what "type" in a custom action this particle belongs to. /// For example, you may want to have one action which could draw one of several different /// images. You can set this value to indicate which image to draw. This does not have /// to be used.
action ParticleAction The action. This should be a reference to a STATIC object, for memory sake.
Résultat bool

Add() public méthode

Adds a Particle.
public Add ( float xPosition, float yPosition, float xVelocity, float yVelocity, Color color, float scale, float rotation, float rotationSpeed, byte actionUniqueIdentifier, ParticleAction action ) : bool
xPosition float The x position.
yPosition float The y position.
xVelocity float The x velocity.
yVelocity float The y velocity.
color Color The color to overlay the drawn image with.
scale float The scale.
rotation float The rotation.
rotationSpeed float The rotation speed.
actionUniqueIdentifier byte This is used to identify what "type" in a custom action this particle belongs to. /// For example, you may want to have one action which could draw one of several different /// images. You can set this value to indicate which image to draw. This does not have /// to be used.
action ParticleAction The action. This should be a reference to a STATIC object, for memory sake.
Résultat bool

ApplyAcceloration() public méthode

Applies the acceloration to all particles.
public ApplyAcceloration ( Vector2 &acceloration ) : void
acceloration Vector2 The acceloration.
Résultat void

Draw() public méthode

Draws this instance.
public Draw ( ) : void
Résultat void

ParticleContainer() public méthode

Initializes a new instance of the ParticleContainer class.
public ParticleContainer ( int maxParticles ) : System
maxParticles int The maximum number of particles.
Résultat System

Reset() public méthode

Resets this instance.
public Reset ( ) : void
Résultat void

Update() public méthode

Updates this instance.
public Update ( ) : void
Résultat void