C# Class FontEffectsLib.SpriteTypes.GameSprite

Inheritance: FontEffectsLib.CoreTypes.BaseGameObject
Mostra file Open project: GreatMindsRobotics/FontEffectsLib Class Usage Examples

Protected Properties

Property Type Description
_sourceRectangle Rectangle?
_texture Microsoft.Xna.Framework.Graphics.Texture2D

Public Methods

Method Description
CreateSolidColor ( Vector2 pos, int width, int height, Color color, GraphicsDevice gDev ) : GameSprite

Creates a GameSprite of a solid color. The tint color of the resulting object is white.

Draw ( SpriteBatch spriteBatch ) : void

Draws this GameSprite to the specified SpriteBatch.

GameSprite ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Color tintColor ) : System

Creates a new GameSprite.

ScaleToViewport ( Viewport viewport ) : void

Scales this GameSprite based on current Viewport size.

SetCenterAsOrigin ( ) : void

Sets the center of this GameSprite as the rendering origin.

Update ( GameTime gameTime ) : void

Updates this GameSprite.

Intended to be overridden by a subclass.

Method Details

CreateSolidColor() public static method

Creates a GameSprite of a solid color. The tint color of the resulting object is white.
public static CreateSolidColor ( Vector2 pos, int width, int height, Color color, GraphicsDevice gDev ) : GameSprite
pos Vector2 The position of the new sprite.
width int The initial width of the new sprite.
height int The initial height of the new sprite.
color Color The color of the texture of the new sprite.
gDev GraphicsDevice The to use in the texture initialization of the new sprite.
return GameSprite

Draw() public method

Draws this GameSprite to the specified SpriteBatch.
public Draw ( SpriteBatch spriteBatch ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch The to render this to.
return void

GameSprite() public method

Creates a new GameSprite.
public GameSprite ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, Color tintColor ) : System
texture Microsoft.Xna.Framework.Graphics.Texture2D The image to display on the .
position Vector2
tintColor Color
return System

ScaleToViewport() public method

Scales this GameSprite based on current Viewport size.
public ScaleToViewport ( Viewport viewport ) : void
viewport Microsoft.Xna.Framework.Graphics.Viewport Current
return void

SetCenterAsOrigin() public method

Sets the center of this GameSprite as the rendering origin.
public SetCenterAsOrigin ( ) : void
return void

Update() public method

Updates this GameSprite.
Intended to be overridden by a subclass.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime A snapshot of the game timing state values.
return void

Property Details

_sourceRectangle protected_oe property

protected Rectangle? _sourceRectangle
return Rectangle?

_texture protected_oe property

protected Texture2D,Microsoft.Xna.Framework.Graphics _texture
return Microsoft.Xna.Framework.Graphics.Texture2D