C# Class WarTornLands.Infrastructure.ResolutionIndependence.MagicSprite

A magic sprite is a texture with a fix position on the screen, beeing drawn in the right spot depending on the current solution. It is not affected by the camera.
Datei anzeigen Open project: floAr/WarTornLands Class Usage Examples

Public Methods

Method Description
Draw ( ) : void
MagicSprite ( SpriteBatch sb, Microsoft.Xna.Framework.Graphics.Texture2D sprite, Vector2 relPosition, float relWidth, float relHeight, float Xpan, float Ypan ) : System

Initializes a new instance of the MagicSprite class. It is possible to pass null for either relWidth or relHeight. In this case the respective other value is calculated in respect to the sprites aspect ratio to ensure a non-warped presentation.

Private Methods

Method Description
CheckOverride ( ) : void
GetDrawingRec ( ) : void

Method Details

Draw() public method

public Draw ( ) : void
return void

MagicSprite() public method

Initializes a new instance of the MagicSprite class. It is possible to pass null for either relWidth or relHeight. In this case the respective other value is calculated in respect to the sprites aspect ratio to ensure a non-warped presentation.
Sprite dimensions not specified. Called in case both width and height are passed as null.
public MagicSprite ( SpriteBatch sb, Microsoft.Xna.Framework.Graphics.Texture2D sprite, Vector2 relPosition, float relWidth, float relHeight, float Xpan, float Ypan ) : System
sb Microsoft.Xna.Framework.Graphics.SpriteBatch The SpriteBatch used to draw the sprite.
sprite Microsoft.Xna.Framework.Graphics.Texture2D The sprite texture.
relPosition Vector2 The relative position.
relWidth float The relative width.
relHeight float The relative height.
Xpan float The pan in X-direction.
Ypan float The pan in Y-direction.
return System