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

Class representing a sprite drawn on screen with all generic properties and methods More...

Public Member Functions

 Sprite (Texture2D texture)
 Create a new sprite from a Texture2D
void Initialize (Texture2D texture)
 Reinitialize this sprite using another Texture2D
Rectangle GetRectangle ()
 Get the simple positioned rectangle for this sprite. Neither Scale, Rotation or SpriteEffects are applied
Rectangle GetScaledRectangle ()
 Get the simple positioned rectangle for this sprite. Scale is applied, but Rotation and SpriteEffects are not
Rectangle GetFullRectangle ()
 Get the fully modified positioned rectangle for this sprite. Scale, Rotation and SpriteEffects are applied
void Dispose ()
 Used to explicitly free all resources currently in use by this object before destruction
bool IsDisposed ()
 Is this Texture disposed?

Static Public Member Functions

static operator Sprite (Texture2D value)
 Cache fix: Sprite from a Texture2D cast

Public Attributes

SpriteEffects Effects = SpriteEffects.None
 Effects to apply to the sprite

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

Vector2 Position [get, set]
 Position of the sprite on screen
Vector2 Origin [get, set]
 Origin to draw the sprite from
Color Color [get, set]
 Color of the sprite
float Rotation [get, set]
 Rotation of the sprite in degrees
Vector2 Scale [get, set]
 Scale of the sprite
Rectangle SourceRectangle [get, set]
 Rectangle of the sprite to draw on screen
Size FullSize [get]
 Full size of the sprite
Rectangle FullRectangle [get, set]
 Full rectangle of the sprite
bool Disposed [get, set]
 Is this Texture disposed?

Detailed Description

Class representing a sprite drawn on screen with all generic properties and methods

Constructor & Destructor Documentation

MuGameFramework.Graphics.Sprite.Sprite ( Texture2D  texture)

Create a new sprite from a Texture2D

Parameters
textureTexture to create the sprite from

Member Function Documentation

virtual void MuGameFramework.Graphics.Sprite.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.Sprite.Dispose ( )

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

Rectangle MuGameFramework.Graphics.Sprite.GetFullRectangle ( )

Get the fully modified positioned rectangle for this sprite. Scale, Rotation and SpriteEffects are applied

Returns
Fully modified positioned rectangle
Rectangle MuGameFramework.Graphics.Sprite.GetRectangle ( )

Get the simple positioned rectangle for this sprite. Neither Scale, Rotation or SpriteEffects are applied

Returns
Simple positioned rectangle for this sprite
Rectangle MuGameFramework.Graphics.Sprite.GetScaledRectangle ( )

Get the simple positioned rectangle for this sprite. Scale is applied, but Rotation and SpriteEffects are not

Returns
Simple positioned rectangle w. Sca;e
void MuGameFramework.Graphics.Sprite.Initialize ( Texture2D  texture)

Reinitialize this sprite using another Texture2D

Parameters
textureTexture to create the sprite from
bool MuGameFramework.Graphics.Sprite.IsDisposed ( )

Is this Texture disposed?

Returns
Is this Texture disposed?
static MuGameFramework.Graphics.Sprite.operator Sprite ( Texture2D  value)
explicitstatic

Cache fix: Sprite from a Texture2D cast

Parameters
valueTexture2D to get a Sprite for
Returns
New Sprite

Member Data Documentation

SpriteEffects MuGameFramework.Graphics.Sprite.Effects = SpriteEffects.None

Effects to apply to the sprite

Property Documentation

Color MuGameFramework.Graphics.Sprite.Color
getset

Color of the sprite

bool MuGameFramework.Graphics.Sprite.Disposed
getset

Is this Texture disposed?

Rectangle MuGameFramework.Graphics.Sprite.FullRectangle
getset

Full rectangle of the sprite

Size MuGameFramework.Graphics.Sprite.FullSize
get

Full size of the sprite

Vector2 MuGameFramework.Graphics.Sprite.Origin
getset

Origin to draw the sprite from

Vector2 MuGameFramework.Graphics.Sprite.Position
getset

Position of the sprite on screen

float MuGameFramework.Graphics.Sprite.Rotation
getset

Rotation of the sprite in degrees

Vector2 MuGameFramework.Graphics.Sprite.Scale
getset

Scale of the sprite

Rectangle MuGameFramework.Graphics.Sprite.SourceRectangle
getset

Rectangle of the sprite to draw on screen


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