C# Class MyGame.BillboardSystem

This class represent a Billboard System a group of 2D textures(pictures) that are always drawn facing the camera
Inheritance: Microsoft.Xna.Framework.DrawableGameComponent
Show file Open project: mahmoudbahaa/XNA-Game-project Class Usage Examples

Public Properties

Property Type Description
EnsureOcclusion bool
Mode BillboardMode

Public Methods

Method Description
BillboardSystem ( Game game, Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 billboardSize, Vector3 particlePositions ) : System

Constructor that initialize the billboard attributes

Draw ( GameTime gameTime ) : void

This method renders the current state.

drawBillboards ( ) : void
drawOpaquePixels ( ) : void
drawTransparentPixels ( ) : void
generateParticles ( Vector3 particlePositions ) : void

Generate the particles (vertex and index array) for each billboard

setEffectParameters ( ) : void

Set the billboard effect paramaters

Method Details

BillboardSystem() public method

Constructor that initialize the billboard attributes
public BillboardSystem ( Game game, Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 billboardSize, Vector3 particlePositions ) : System
game Game Instance of MyGame this drawable game component is attached to
texture Microsoft.Xna.Framework.Graphics.Texture2D The Texture2D(2D picture) that is drawn at every position
billboardSize Vector2 Size of billboard
particlePositions Vector3 Positions of the billboards
return System

Draw() public method

This method renders the current state.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The elapsed game time.
return void

drawBillboards() public method

public drawBillboards ( ) : void
return void

drawOpaquePixels() public method

public drawOpaquePixels ( ) : void
return void

drawTransparentPixels() public method

public drawTransparentPixels ( ) : void
return void

generateParticles() public method

Generate the particles (vertex and index array) for each billboard
public generateParticles ( Vector3 particlePositions ) : void
particlePositions Vector3 Positions of the billboards
return void

setEffectParameters() public method

Set the billboard effect paramaters
public setEffectParameters ( ) : void
return void

Property Details

EnsureOcclusion public property

public bool EnsureOcclusion
return bool

Mode public property

public BillboardMode Mode
return BillboardMode