C# Class SGDE.Graphics.Sprite

A drawable sprite object that can be displayed on screen.
Inheritance: SceneNode, IDrawable
Afficher le fichier Open project: sgdc/sgdc-old

Protected Properties

Свойство Type Description
overrideAtt SpriteAttributes

Private Properties

Свойство Type Description
AdjustOrderTranslation void
CopySpriteToIn void
SetAnimation void

Méthodes publiques

Méthode Description
Draw ( GameTime gameTime ) : void

Draw this Sprite.

GetAnimationEffect ( ) : SpriteEffects

Get animation effect for the current frame of animation.

GetAnimationFrame ( ) : Rectangle?

Get animation frame, if it exists, for the current frame of animation.

GetAnimationOrigin ( ) : Vector2?

Get animation origin, if it exists, for the current frame of animation.

GetAnimationRotation ( ) : float?

Get animation rotation, if it exists, for the current frame of animation.

GetAnimationScale ( ) : Vector2?

Get animation scale, if it exists, for the current frame of animation.

GetAnimationTint ( ) : Color?

Get animation tint, if it exists, for the current frame of animation.

OverrideAnimation ( SpriteAttributes component, bool allowed ) : bool

Some attributes about a Sprite can be determined by it's animation. This function allows the determination of what attributes are allowed to be set by the animation and what are user determined.

SetAnimation ( int id ) : bool

Set the animation for the Sprite. IMPORTANT: If the animation is successfully set then the FPS, current frame of animation, and animation region are reset to the default values of the animation.

SetAnimation ( int id, bool checkGlobal ) : bool

Set the animation for the Sprite. IMPORTANT: If the animation is successfully set then the FPS, current frame of animation, and animation region are reset to the default values of the animation.

SetAnimation ( int id, bool checkGlobal, bool global ) : bool

Set the animation for the Sprite. IMPORTANT: If the animation is successfully set then the FPS, current frame of animation, and animation region are reset to the default values of the animation.

SetAnimation ( string gameElement ) : bool

Set the animation for the Sprite. IMPORTANT: If the animation is successfully set then the FPS, current frame of animation, and animation region are reset to the default values of the animation.

Update ( GameTime gameTime ) : void

Update this Sprite.

Méthodes protégées

Méthode Description
CopySpriteTo ( Sprite &sp, bool full ) : void

Copy this Sprite to another Sprite.

Sprite ( ) : System

Create a new Sprite with default values.

Private Methods

Méthode Description
AdjustOrderTranslation ( ) : void
CopySpriteToIn ( Sprite &sp, bool full ) : void
SetAnimation ( SpriteManager ani ) : void

Method Details

CopySpriteTo() protected abstract méthode

Copy this Sprite to another Sprite.
protected abstract CopySpriteTo ( Sprite &sp, bool full ) : void
sp Sprite The Sprite to copy to.
full bool true if the entire Sprite should be copied, false if only changes should get copied.
Résultat void

Draw() public abstract méthode

Draw this Sprite.
public abstract Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The GameTime since the last draw.
Résultat void

GetAnimationEffect() public méthode

Get animation effect for the current frame of animation.
public GetAnimationEffect ( ) : SpriteEffects
Résultat SpriteEffects

GetAnimationFrame() public méthode

Get animation frame, if it exists, for the current frame of animation.
public GetAnimationFrame ( ) : Rectangle?
Résultat Rectangle?

GetAnimationOrigin() public méthode

Get animation origin, if it exists, for the current frame of animation.
public GetAnimationOrigin ( ) : Vector2?
Résultat Vector2?

GetAnimationRotation() public méthode

Get animation rotation, if it exists, for the current frame of animation.
public GetAnimationRotation ( ) : float?
Résultat float?

GetAnimationScale() public méthode

Get animation scale, if it exists, for the current frame of animation.
public GetAnimationScale ( ) : Vector2?
Résultat Vector2?

GetAnimationTint() public méthode

Get animation tint, if it exists, for the current frame of animation.
public GetAnimationTint ( ) : Color?
Résultat Color?

OverrideAnimation() public méthode

Some attributes about a Sprite can be determined by it's animation. This function allows the determination of what attributes are allowed to be set by the animation and what are user determined.
public OverrideAnimation ( SpriteAttributes component, bool allowed ) : bool
component SpriteAttributes What component of the Sprite should be get/set.
allowed bool true if this compoennt can be overriden by the Sprite's animation, false is otherwise. Can also be set to null if the value should be returned.
Résultat bool

SetAnimation() public méthode

Set the animation for the Sprite. IMPORTANT: If the animation is successfully set then the FPS, current frame of animation, and animation region are reset to the default values of the animation.
public SetAnimation ( int id ) : bool
id int The ID of the animation. This is the ID used locally by the Sprite.
Résultat bool

SetAnimation() public méthode

Set the animation for the Sprite. IMPORTANT: If the animation is successfully set then the FPS, current frame of animation, and animation region are reset to the default values of the animation.
public SetAnimation ( int id, bool checkGlobal ) : bool
id int The ID of the animation. This is the ID used locally by the Sprite, if the ID could identify global animations then the ID can identify a global animation ID.
checkGlobal bool If global animation should be checked if Sprite specific animation is not found.
Résultat bool

SetAnimation() public méthode

Set the animation for the Sprite. IMPORTANT: If the animation is successfully set then the FPS, current frame of animation, and animation region are reset to the default values of the animation.
public SetAnimation ( int id, bool checkGlobal, bool global ) : bool
id int The ID of the animation. This is the ID used locally by the Sprite, if the ID could identify global animations then the ID can identify a global animation ID.
checkGlobal bool If global animation should be checked if Sprite specific animation is not found.
global bool If global animation should be checked before Sprite specific animation. If this is true than is ignored.
Résultat bool

SetAnimation() public méthode

Set the animation for the Sprite. IMPORTANT: If the animation is successfully set then the FPS, current frame of animation, and animation region are reset to the default values of the animation.
public SetAnimation ( string gameElement ) : bool
gameElement string The Asset ID of the animation.
Résultat bool

Sprite() protected méthode

Create a new Sprite with default values.
protected Sprite ( ) : System
Résultat System

Update() public méthode

Update this Sprite.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The GameTime since the last update.
Résultat void

Property Details

overrideAtt protected_oe property

The current SpriteAttributes that can override the Sprite's default attributes.
protected SpriteAttributes overrideAtt
Résultat SpriteAttributes