C# 클래스 Project290.Rendering.Drawer

This static public class is used for all rendering in the game. It can be called from anywhere, but do not attempt to use it until the Initiallize() method has been called (this only needs to happen once ever).
파일 보기 프로젝트 열기: scastle/Solitude

공개 메소드들

메소드 설명
Draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture2D, Rectangle destinationRectangle, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth ) : void

Draws the specified texture2D, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.

Draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture2D, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth ) : void

Draws the specified texture2D, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.

Draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture2D, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth ) : void

Draws the specified texture2D, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.

DrawControllerSymbol ( Buttons button, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects spriteEffects, float layerDepth ) : void

Draws the specified controller symbol, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.

DrawLine ( Vector2 pointA, Vector2 pointB, float width, float layerDepth, Color color ) : void

Draws a black line from point A to point B.

DrawOutlinedString ( SpriteFont font, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects spriteEffects, float layerDepth ) : void

Draws the specified string in the specified font, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls. This creates a black outline around the string.

DrawRectangle ( Rectangle toDraw, float width, float layerDepth, Color color ) : void

Draws the rectangle.

DrawString ( SpriteFont font, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects spriteEffects, float layerDepth ) : void

Draws the specified string in the specified font, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.

DrawString ( SpriteFont font, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects spriteEffects, float layerDepth ) : void

Draws the specified string in the specified font, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.

FormatNumber ( uint value ) : string

Formats the number. For example, 12345 returns "12,345".

GetControllerSymbolMap ( char input ) : char

Gets the controller symbol mapping.

GetRatio ( ) : float

This returns the ratio of the screen height to 1080, in the event that the TV is not at a 1080i or 1080p resolution. All scales and positions should be multiplied by this in order to correctly adjust to any screen resolution, while always assuming that the screen is 1920 * 1080.

Initiallize ( ) : void

Initiallizes the static variables used by this static public class..

비공개 메소드들

메소드 설명
GetLayerDepthScale ( float layerDepth ) : float

Gets the layer depth scale (so screens will be drawn on top of each other without having to worry about layer depths).

메소드 상세

Draw() 공개 정적인 메소드

Draws the specified texture2D, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.
public static Draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture2D, Rectangle destinationRectangle, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth ) : void
texture2D Microsoft.Xna.Framework.Graphics.Texture2D The texture2 D.
destinationRectangle Microsoft.Xna.Framework.Rectangle The destination rectangle.
sourceRectangle Microsoft.Xna.Framework.Rectangle The source rectangle.
color Color The color.
rotation float The rotation.
origin Vector2 The origin.
effects SpriteEffects The effects.
layerDepth float The layer depth.
리턴 void

Draw() 공개 정적인 메소드

Draws the specified texture2D, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.
public static Draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture2D, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth ) : void
texture2D Microsoft.Xna.Framework.Graphics.Texture2D The texture2D.
position Vector2 The position.
sourceRectangle Microsoft.Xna.Framework.Rectangle The source rectangle.
color Color The color.
rotation float The rotation.
origin Vector2 The origin.
scale Vector2 The scale.
effects SpriteEffects The effects.
layerDepth float The layer depth.
리턴 void

Draw() 공개 정적인 메소드

Draws the specified texture2D, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.
public static Draw ( Microsoft.Xna.Framework.Graphics.Texture2D texture2D, Vector2 position, Rectangle sourceRectangle, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth ) : void
texture2D Microsoft.Xna.Framework.Graphics.Texture2D The texture2 D.
position Vector2 The position.
sourceRectangle Microsoft.Xna.Framework.Rectangle The source rectangle.
color Color The color.
rotation float The rotation.
origin Vector2 The origin.
scale float The scale.
effects SpriteEffects The effects.
layerDepth float The layer depth.
리턴 void

DrawControllerSymbol() 공개 정적인 메소드

Draws the specified controller symbol, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.
public static DrawControllerSymbol ( Buttons button, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects spriteEffects, float layerDepth ) : void
button Buttons The button to draw.
position Vector2 The position.
color Color The color of the string.
rotation float The rotation.
origin Vector2 The origin.
scale float The scale.
spriteEffects SpriteEffects The sprite effects.
layerDepth float The layer depth.
리턴 void

DrawLine() 공개 정적인 메소드

Draws a black line from point A to point B.
public static DrawLine ( Vector2 pointA, Vector2 pointB, float width, float layerDepth, Color color ) : void
pointA Vector2 The point A.
pointB Vector2 The point B.
width float The width.
layerDepth float The layer depth.
color Color The color.
리턴 void

DrawOutlinedString() 공개 정적인 메소드

Draws the specified string in the specified font, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls. This creates a black outline around the string.
public static DrawOutlinedString ( SpriteFont font, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects spriteEffects, float layerDepth ) : void
font Microsoft.Xna.Framework.Graphics.SpriteFont The font.
text string The text to write.
position Vector2 The position.
color Color The color of the string.
rotation float The rotation.
origin Vector2 The origin.
scale float The scale.
spriteEffects SpriteEffects The sprite effects.
layerDepth float The layer depth.
리턴 void

DrawRectangle() 공개 정적인 메소드

Draws the rectangle.
public static DrawRectangle ( Rectangle toDraw, float width, float layerDepth, Color color ) : void
toDraw Microsoft.Xna.Framework.Rectangle The rectangle to draw.
width float The width.
layerDepth float The layer depth.
color Color The color.
리턴 void

DrawString() 공개 정적인 메소드

Draws the specified string in the specified font, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.
public static DrawString ( SpriteFont font, string text, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects spriteEffects, float layerDepth ) : void
font Microsoft.Xna.Framework.Graphics.SpriteFont The font.
text string The text to write.
position Vector2 The position.
color Color The color of the string.
rotation float The rotation.
origin Vector2 The origin.
scale Vector2 The scale.
spriteEffects SpriteEffects The sprite effects.
layerDepth float The layer depth.
리턴 void

DrawString() 공개 정적인 메소드

Draws the specified string in the specified font, assuming that it was drawn assuming the screen is exactly 1920 * 1080. Be sure to call spriteBatch.Begin() before this and spriteBatch.End() at the end of the series of Drawing calls.
public static DrawString ( SpriteFont font, string text, Vector2 position, Color color, float rotation, Vector2 origin, float scale, SpriteEffects spriteEffects, float layerDepth ) : void
font Microsoft.Xna.Framework.Graphics.SpriteFont The font.
text string The text to write.
position Vector2 The position.
color Color The color of the string.
rotation float The rotation.
origin Vector2 The origin.
scale float The scale.
spriteEffects SpriteEffects The sprite effects.
layerDepth float The layer depth.
리턴 void

FormatNumber() 공개 정적인 메소드

Formats the number. For example, 12345 returns "12,345".
public static FormatNumber ( uint value ) : string
value uint The value.
리턴 string

GetControllerSymbolMap() 공개 정적인 메소드

Gets the controller symbol mapping.
public static GetControllerSymbolMap ( char input ) : char
input char The input.
리턴 char

GetRatio() 공개 정적인 메소드

This returns the ratio of the screen height to 1080, in the event that the TV is not at a 1080i or 1080p resolution. All scales and positions should be multiplied by this in order to correctly adjust to any screen resolution, while always assuming that the screen is 1920 * 1080.
public static GetRatio ( ) : float
리턴 float

Initiallize() 공개 정적인 메소드

Initiallizes the static variables used by this static public class..
public static Initiallize ( ) : void
리턴 void