C# Класс MonoGameFoundation.Sprite

A sprite to animate via a sprite sheet.
Наследование: Microsoft.Xna.Framework.DrawableGameComponent
Показать файл Открыть проект

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

Метод Описание
Draw ( GameTime gameTime ) : void

Draws the sprite.

Initialize ( ) : void

Initializes the sprite.

This creates the SpriteBatch. If you override Initialize, be sure to call base.Initialize to create the SpriteBatch.

Sprite ( Microsoft.Xna.Framework.Game game, Microsoft.Xna.Framework.Graphics.Texture2D spriteSheet, int pixelWidth, int pixelHeight, int pixelOffsetX, int pixelOffsetY ) : System

Creates a new Sprite instance.

Update ( GameTime gameTime ) : void

Updates the sprite's current animation.

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

Метод Описание
BeginSpriteBatch ( ) : void

Calls SpriteBatch.Begin with default arguments. Override if you need to change the arguments to SpriteBatch.Begin.

Sprite ( Microsoft.Xna.Framework.Game game, Microsoft.Xna.Framework.Graphics.Texture2D spriteSheet, int pixelWidth, int pixelHeight, int pixelOffsetX, int pixelOffsetY, Vector2 pixelPosition ) : System

Creates a new Sprite instance.

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

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

Calls SpriteBatch.Begin with default arguments. Override if you need to change the arguments to SpriteBatch.Begin.
protected BeginSpriteBatch ( ) : void
Результат void

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

Draws the sprite.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The game's current time.
Результат void

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

Initializes the sprite.
This creates the SpriteBatch. If you override Initialize, be sure to call base.Initialize to create the SpriteBatch.
public Initialize ( ) : void
Результат void

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

Creates a new Sprite instance.
public Sprite ( Microsoft.Xna.Framework.Game game, Microsoft.Xna.Framework.Graphics.Texture2D spriteSheet, int pixelWidth, int pixelHeight, int pixelOffsetX, int pixelOffsetY ) : System
game Microsoft.Xna.Framework.Game The global game instance.
spriteSheet Microsoft.Xna.Framework.Graphics.Texture2D The sprite sheet containing the sprite's animation frames.
pixelWidth int The width of the sprite in pixels.
pixelHeight int The height of the sprite in pixels.
pixelOffsetX int The sprite's X offset, used to to center the sprite on its location.
pixelOffsetY int The sprite's Y offset, used to to center the sprite on its location.
Результат System

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

Creates a new Sprite instance.
protected Sprite ( Microsoft.Xna.Framework.Game game, Microsoft.Xna.Framework.Graphics.Texture2D spriteSheet, int pixelWidth, int pixelHeight, int pixelOffsetX, int pixelOffsetY, Vector2 pixelPosition ) : System
game Microsoft.Xna.Framework.Game The global game instance.
spriteSheet Microsoft.Xna.Framework.Graphics.Texture2D The sprite sheet containing the sprite's animation frames.
pixelWidth int The width of the sprite in pixels.
pixelHeight int The height of the sprite in pixels.
pixelOffsetX int The sprite's X offset, used to to center the sprite on its location.
pixelOffsetY int The sprite's Y offset, used to to center the sprite on its location.
pixelPosition Vector2 The sprite position in the display, in pixels.
Результат System

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

Updates the sprite's current animation.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The game's current time.
Результат void