C# Класс SGDE.Graphics.Sprite

A drawable sprite object that can be displayed on screen.
Наследование: SceneNode, IDrawable
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
overrideAtt SpriteAttributes

Private Properties

Свойство Тип Описание
AdjustOrderTranslation void
CopySpriteToIn void
SetAnimation void

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
CopySpriteTo ( Sprite &sp, bool full ) : void

Copy this Sprite to another Sprite.

Sprite ( ) : System

Create a new Sprite with default values.

Приватные методы

Метод Описание
AdjustOrderTranslation ( ) : void
CopySpriteToIn ( Sprite &sp, bool full ) : void
SetAnimation ( SpriteManager ani ) : void

Описание методов

CopySpriteTo() защищенный абстрактный Метод

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.
Результат void

Draw() публичный абстрактный Метод

Draw this Sprite.
public abstract Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The GameTime since the last draw.
Результат void

GetAnimationEffect() публичный Метод

Get animation effect for the current frame of animation.
public GetAnimationEffect ( ) : SpriteEffects
Результат SpriteEffects

GetAnimationFrame() публичный Метод

Get animation frame, if it exists, for the current frame of animation.
public GetAnimationFrame ( ) : Rectangle?
Результат Rectangle?

GetAnimationOrigin() публичный Метод

Get animation origin, if it exists, for the current frame of animation.
public GetAnimationOrigin ( ) : Vector2?
Результат Vector2?

GetAnimationRotation() публичный Метод

Get animation rotation, if it exists, for the current frame of animation.
public GetAnimationRotation ( ) : float?
Результат float?

GetAnimationScale() публичный Метод

Get animation scale, if it exists, for the current frame of animation.
public GetAnimationScale ( ) : Vector2?
Результат Vector2?

GetAnimationTint() публичный Метод

Get animation tint, if it exists, for the current frame of animation.
public GetAnimationTint ( ) : Color?
Результат Color?

OverrideAnimation() публичный Метод

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.
Результат bool

SetAnimation() публичный Метод

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.
Результат bool

SetAnimation() публичный Метод

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.
Результат bool

SetAnimation() публичный Метод

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.
Результат bool

SetAnimation() публичный Метод

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.
Результат bool

Sprite() защищенный Метод

Create a new Sprite with default values.
protected Sprite ( ) : System
Результат System

Update() публичный Метод

Update this Sprite.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The GameTime since the last update.
Результат void

Описание свойств

overrideAtt защищенное свойство

The current SpriteAttributes that can override the Sprite's default attributes.
protected SpriteAttributes overrideAtt
Результат SpriteAttributes