C# 클래스 GameGraphics.Sprite

파일 보기 프로젝트 열기: pmyoung/Advanced-Game-Project

공개 메소드들

메소드 설명
GetFrameHeight ( ) : int

Gets the height of the animation frame

GetFrameWidth ( ) : int

Gets the width of the animation frame

GetSprite ( ) : Microsoft.Xna.Framework.Graphics.Texture2D

Gets the image the sprite uses

GetSpriteType ( ) : string

Gets the type of object this sprite should be used for

Render ( SpriteBatch spriteBatch, GraphicsObject obj ) : void

Renders the given GraphicsObject

Render ( SpriteBatch spriteBatch, Rectangle bounds, Color color, float rotation, Vector2 origin, SpriteEffects effect, float layer, int action, int frame ) : void

Render method that all overloads call.

Render ( SpriteBatch spriteBatch, int x, int y, int radius, Color color, int angle, float layer, int action, int frame ) : void

Render this overload allows basic rendering of a sprite that has circular properties.

SetFrameHeight ( int height ) : void

Sets the height of each frame of animation

SetFrameWidth ( int width ) : void

Sets how wide each frame of animation is

SetSprite ( Microsoft.Xna.Framework.Graphics.Texture2D sprite ) : void

Sets the image that this sprite will use

SetSpriteType ( string type ) : void

Sets the type of sprite that this image will be used with

Sprite ( Microsoft.Xna.Framework.Graphics.Texture2D sprite, int frameWidth, int frameHeight, string type ) : System

The Sprite Constructor that requires a Texture2D object (image file), and the type of object (like ship, planet).

setFrameRectangle ( int width, int height ) : void

Sets the width and height of each frame of animation

메소드 상세

GetFrameHeight() 공개 메소드

Gets the height of the animation frame
public GetFrameHeight ( ) : int
리턴 int

GetFrameWidth() 공개 메소드

Gets the width of the animation frame
public GetFrameWidth ( ) : int
리턴 int

GetSprite() 공개 메소드

Gets the image the sprite uses
public GetSprite ( ) : Microsoft.Xna.Framework.Graphics.Texture2D
리턴 Microsoft.Xna.Framework.Graphics.Texture2D

GetSpriteType() 공개 메소드

Gets the type of object this sprite should be used for
public GetSpriteType ( ) : string
리턴 string

Render() 공개 메소드

Renders the given GraphicsObject
public Render ( SpriteBatch spriteBatch, GraphicsObject obj ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch Contains graphics contexts for rendering on the game screen
obj GraphicsObject The GraphicsObject that is to be rendered
리턴 void

Render() 공개 메소드

Render method that all overloads call.
public Render ( SpriteBatch spriteBatch, Rectangle bounds, Color color, float rotation, Vector2 origin, SpriteEffects effect, float layer, int action, int frame ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch Contains graphics contexts for rendering on the game screen
bounds Microsoft.Xna.Framework.Rectangle The region of the screen the sprite will be drawn at
color Color Changes the color of the sprite
rotation float The amount to rotate the sprite in radians
origin Vector2 The point on the sprite that is used as the center of rotation
effect SpriteEffects Chosen sprite mirroring option (like None, FlipHorizontally)
layer float Represents the depth 0 front of layer 1 back of layer
action int Integer representing what "action" of the sprite to display
frame int Integer representing what "frame" of the action animation to display
리턴 void

Render() 공개 메소드

Render this overload allows basic rendering of a sprite that has circular properties.
public Render ( SpriteBatch spriteBatch, int x, int y, int radius, Color color, int angle, float layer, int action, int frame ) : void
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch Contains graphics contexts for rendering on the game screen
x int The left-right/west-east location of the sprite
y int The up-down/north-south location of the sprite
radius int The radius of the "circle"
color Color Changes the color of the sprite
angle int The angle of the sprite in degrees
layer float Represents the depth 0 front of layer 1 back of layer
action int Integer representing what "action" of the sprite to display
frame int Integer representing what "frame" of the action animation to display
리턴 void

SetFrameHeight() 공개 메소드

Sets the height of each frame of animation
public SetFrameHeight ( int height ) : void
height int The height of the animation frame
리턴 void

SetFrameWidth() 공개 메소드

Sets how wide each frame of animation is
public SetFrameWidth ( int width ) : void
width int The width of the animation frame
리턴 void

SetSprite() 공개 메소드

Sets the image that this sprite will use
public SetSprite ( Microsoft.Xna.Framework.Graphics.Texture2D sprite ) : void
sprite Microsoft.Xna.Framework.Graphics.Texture2D The image that will be used for the sprite
리턴 void

SetSpriteType() 공개 메소드

Sets the type of sprite that this image will be used with
public SetSpriteType ( string type ) : void
type string The type of object this sprite is used for
리턴 void

Sprite() 공개 메소드

The Sprite Constructor that requires a Texture2D object (image file), and the type of object (like ship, planet).
public Sprite ( Microsoft.Xna.Framework.Graphics.Texture2D sprite, int frameWidth, int frameHeight, string type ) : System
sprite Microsoft.Xna.Framework.Graphics.Texture2D sprite The image that the sprite will use
frameWidth int The width of each frame of animation on the sprite
frameHeight int The height of each frame of animation on the sprite
type string type The type of sprite (like Ship, Planet)
리턴 System

setFrameRectangle() 공개 메소드

Sets the width and height of each frame of animation
public setFrameRectangle ( int width, int height ) : void
width int The width of the animation frame
height int The height of the animation frame
리턴 void