MuGameFramework  1.0
MuGameFramework is a 2D game framework built upon C# and SFML
 All Classes Namespaces Files Functions Variables Enumerations Properties
MuGameFramework.Graphics.SpriteBatch Class Reference

Enables Sprites, Strings and Shapes to be drawn on screen More...

Public Member Functions

 SpriteBatch (Window window)
 Create a new instance of the SpriteBatch
void Clear (Color color)
 Clear the current RenderTarget with a certain color
void ChangeRenderTarget (IRenderTarget target)
 Change the current RenderTarget of this SpriteBatch
void SetCameraView (CameraView view)
 Change the current CameraView of this current RenderTarget
void Draw (Sprite sprite)
 Draw a sprite onto the screen
void Draw (Texture2D texture, Vector2 position, Color color)
 Draw a Texture onto the screen
void Draw (Texture2D texture, Vector2 position, Color color, Rectangle sourceRectangle)
 Draw a Texture onto the screen
void Draw (Texture2D texture, Vector2 position, Color color, Rectangle sourceRectangle, Vector2 origin, float rotation)
 Draw a Texture onto the screen
void Draw (Texture2D texture, Vector2 position, Color color, Rectangle sourceRectangle, Vector2 origin, float rotation, Vector2 scale, SpriteEffects effects)
 Draw a Texture onto the screen
void DrawString (Font font, string text, Vector2 position, Color color)
 Draw a line of text onto the screen
void DrawString (Font font, string text, Vector2 position, Color color, Vector2 origin, float rotation, Vector2 scale, uint characterSize, FontStyle style)
 Draw a line of text onto the screen
void DrawShape (Shape shape)
 Draw a Shape onto the screen
void Dispose ()
 Used to explicitly free all resources currently in use by this object before destruction

Public Attributes

bool FrustumCullingEnabled = true
 Enable the disabling of drawing of objects off screen

Protected Member Functions

virtual void Dispose (bool disposing)
 Dispose any and all objects, either managed or unmanaged at the end of this objects lifespan

Properties

Window DefaultWindow [get, set]
 Default window attached to the SpriteBatch

Detailed Description

Enables Sprites, Strings and Shapes to be drawn on screen

Constructor & Destructor Documentation

MuGameFramework.Graphics.SpriteBatch.SpriteBatch ( Window  window)

Create a new instance of the SpriteBatch

Parameters
windowWindow to set as it's default window

Member Function Documentation

void MuGameFramework.Graphics.SpriteBatch.ChangeRenderTarget ( IRenderTarget  target)

Change the current RenderTarget of this SpriteBatch

Parameters
targetNew RenderTarget to set
void MuGameFramework.Graphics.SpriteBatch.Clear ( Color  color)

Clear the current RenderTarget with a certain color

Parameters
colorColor to fill RenderTarget with
virtual void MuGameFramework.Graphics.SpriteBatch.Dispose ( bool  disposing)
protectedvirtual

Dispose any and all objects, either managed or unmanaged at the end of this objects lifespan

Parameters
disposingDispose of Managed objects?
void MuGameFramework.Graphics.SpriteBatch.Dispose ( )

Used to explicitly free all resources currently in use by this object before destruction

void MuGameFramework.Graphics.SpriteBatch.Draw ( Sprite  sprite)

Draw a sprite onto the screen

Parameters
spriteSprite to draw on screen
void MuGameFramework.Graphics.SpriteBatch.Draw ( Texture2D  texture,
Vector2  position,
Color  color 
)

Draw a Texture onto the screen

Parameters
textureTexture to draw
positionPosition to draw it to on screne
colorColor to colour the texture
void MuGameFramework.Graphics.SpriteBatch.Draw ( Texture2D  texture,
Vector2  position,
Color  color,
Rectangle  sourceRectangle 
)

Draw a Texture onto the screen

Parameters
textureTexture to draw
positionPosition to draw it to on screne
colorColor to colour the texture
sourceRectangleSection of the sprite to draw on screen
void MuGameFramework.Graphics.SpriteBatch.Draw ( Texture2D  texture,
Vector2  position,
Color  color,
Rectangle  sourceRectangle,
Vector2  origin,
float  rotation 
)

Draw a Texture onto the screen

Parameters
textureTexture to draw
positionPosition to draw it to on screne
colorColor to colour the texture
sourceRectangleSection of the sprite to draw on screen
originOrigin of the sprite
rotationRotation of the sprite (in degrees)
void MuGameFramework.Graphics.SpriteBatch.Draw ( Texture2D  texture,
Vector2  position,
Color  color,
Rectangle  sourceRectangle,
Vector2  origin,
float  rotation,
Vector2  scale,
SpriteEffects  effects 
)

Draw a Texture onto the screen

Parameters
textureTexture to draw
positionPosition to draw it to on screne
colorColor to colour the texture
sourceRectangleSection of the sprite to draw on screen
originOrigin of the sprite
rotationRotation of the sprite (in degrees)
scaleScale of the sprite
effectsEffects to apply to the sprite
void MuGameFramework.Graphics.SpriteBatch.DrawShape ( Shape  shape)

Draw a Shape onto the screen

Parameters
shapeShape to draw on screen
void MuGameFramework.Graphics.SpriteBatch.DrawString ( Font  font,
string  text,
Vector2  position,
Color  color 
)

Draw a line of text onto the screen

Parameters
fontFont to draw with
textText to draw
positionPosition to draw it to on screen
colorColor to colour the text
void MuGameFramework.Graphics.SpriteBatch.DrawString ( Font  font,
string  text,
Vector2  position,
Color  color,
Vector2  origin,
float  rotation,
Vector2  scale,
uint  characterSize,
FontStyle  style 
)

Draw a line of text onto the screen

Parameters
fontFont to draw with
textText to draw
positionPosition to draw it to on screen
colorColor to colour the text
originOrigin of the text
rotationRotation of the text (in degrees)
scaleScale of the text
characterSizeSize of the characters
styleString styling
void MuGameFramework.Graphics.SpriteBatch.SetCameraView ( CameraView  view)

Change the current CameraView of this current RenderTarget

Parameters
viewNew CameraView to set

Member Data Documentation

bool MuGameFramework.Graphics.SpriteBatch.FrustumCullingEnabled = true

Enable the disabling of drawing of objects off screen

Property Documentation

Window MuGameFramework.Graphics.SpriteBatch.DefaultWindow
getset

Default window attached to the SpriteBatch


The documentation for this class was generated from the following file: