C# 클래스 MonoGameFoundation.Sprite

A sprite to animate via a sprite sheet.
상속: Microsoft.Xna.Framework.DrawableGameComponent
파일 보기 프로젝트 열기: half-ogre/MonoGameQuest

공개 메소드들

메소드 설명
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