C# 클래스 ARCed.XnaExtensions

파일 보기 프로젝트 열기: borisblizzard/arcreator

공개 메소드들

메소드 설명
DrawRectangle ( this batch, Rectangle rect, Microsoft.Xna.Framework.Color color, int border = 1 ) : void

Draws a rectangle with given location, size, color, and border width.

DrawRectangle ( this batch, int x, int y, int width, int height, Microsoft.Xna.Framework.Color color, int border = 1 ) : void

Draws a rectangle with given location, size, color, and border width.

DrawSelectionRect ( this batch, Rectangle rect, Microsoft.Xna.Framework.Color color, int thickness = 1 ) : void

Draws a bordered selection rectangle around the given rectangle.

DrawString ( this batch, string text, Font font, Microsoft.Xna.Framework.Color color, Rectangle rect ) : void

Draws the specified string using the given font and location.

Without the use of a ContentPipeline, it is necessary to use GDI+ to draw the font onto a bitmap and transfer it to a texture.

FillRectangle ( this batch, Rectangle rect, Microsoft.Xna.Framework.Color color ) : void

Draws and fills a rectangle with given location, size, and color.

FillRectangle ( this batch, int x, int y, int width, int height, Microsoft.Xna.Framework.Color color ) : void

Draws and fills a rectangle with given location, size, and color.

FillTriangle ( this batch, Vector2 p1, Vector2 p2, Vector2 p3, Microsoft.Xna.Framework.Color color ) : void

Draws and fills a triangle using the given points and color.

ToImage ( this texture ) : Image

Converts a Texture2D to an System.Drawing.Image and returns it.

ToSystemColor ( this color ) : System.Drawing.Microsoft.Xna.Framework.Color

Converts and returns a Microsoft.Xna.Framework.Color to a System.Drawing.Color.

ToSystemRect ( this rect ) : System.Drawing.Microsoft.Xna.Framework.Rectangle

Converts a Microsoft.Xna.Framework.Rectangle to a System.Drawing.Rectangle and returns it.

ToTexture ( this image, GraphicsDevice device ) : Microsoft.Xna.Framework.Graphics.Texture2D

Converts a Image to a Texture2D and returns it.

ToXnaColor ( this color ) : Microsoft.Xna.Framework.Color

Converts and returns a System.Drawing.Color to a Microsoft.Xna.Framework.Color.

ToXnaRect ( this rect ) : Rectangle

Converts a System.Drawing.Rectangle to a Microsoft.Xna.Framework.Rectangle and returns it.

메소드 상세

DrawRectangle() 공개 정적인 메소드

Draws a rectangle with given location, size, color, and border width.
public static DrawRectangle ( this batch, Rectangle rect, Microsoft.Xna.Framework.Color color, int border = 1 ) : void
batch this SpriteBatch to draw the rectangle.
rect Microsoft.Xna.Framework.Rectangle Rectangle to draw.
color Microsoft.Xna.Framework.Color Color to draw rectangle.
border int Width of the border in pixels
리턴 void

DrawRectangle() 공개 정적인 메소드

Draws a rectangle with given location, size, color, and border width.
public static DrawRectangle ( this batch, int x, int y, int width, int height, Microsoft.Xna.Framework.Color color, int border = 1 ) : void
batch this SpriteBatch to draw the rectangle.
x int Coordinate of the rectangle on the x-axis
y int Coordinate of the rectangle on the y-axis
width int Width of the rectangle in pixels
height int Height of the rectangle in pixels
color Microsoft.Xna.Framework.Color Color of the rectangle border
border int Width of the border in pixels
리턴 void

DrawSelectionRect() 공개 정적인 메소드

Draws a bordered selection rectangle around the given rectangle.
public static DrawSelectionRect ( this batch, Rectangle rect, Microsoft.Xna.Framework.Color color, int thickness = 1 ) : void
batch this SpriteBatch to draw the rectangle.
rect Microsoft.Xna.Framework.Rectangle Rectangle to draw
color Microsoft.Xna.Framework.Color Color of the rectangle border
thickness int Thickness, in pixels, of the inner selection rectangle
리턴 void

DrawString() 공개 정적인 메소드

Draws the specified string using the given font and location.
Without the use of a ContentPipeline, it is necessary to use GDI+ to draw the font onto a bitmap and transfer it to a texture.
public static DrawString ( this batch, string text, Font font, Microsoft.Xna.Framework.Color color, Rectangle rect ) : void
batch this SpriteBatch to draw the string
text string Text to draw
font System.Drawing.Font Font to draw text with.
color Microsoft.Xna.Framework.Color Color of the text.
rect Microsoft.Xna.Framework.Rectangle Rectangle where text will be drawn.
리턴 void

FillRectangle() 공개 정적인 메소드

Draws and fills a rectangle with given location, size, and color.
public static FillRectangle ( this batch, Rectangle rect, Microsoft.Xna.Framework.Color color ) : void
batch this SpriteBatch to draw the rectangle.
rect Microsoft.Xna.Framework.Rectangle Rectangle to draw
color Microsoft.Xna.Framework.Color Color of the rectangle border
리턴 void

FillRectangle() 공개 정적인 메소드

Draws and fills a rectangle with given location, size, and color.
public static FillRectangle ( this batch, int x, int y, int width, int height, Microsoft.Xna.Framework.Color color ) : void
batch this SpriteBatch to draw the rectangle.
x int Coordinate of the rectangle on the x-axis
y int Coordinate of the rectangle on the y-axis
width int Width of the rectangle in pixels
height int Height of the rectangle in pixels
color Microsoft.Xna.Framework.Color Color of the rectangle border
리턴 void

FillTriangle() 공개 정적인 메소드

Draws and fills a triangle using the given points and color.
public static FillTriangle ( this batch, Vector2 p1, Vector2 p2, Vector2 p3, Microsoft.Xna.Framework.Color color ) : void
batch this SpriteBatch to draw triangle
p1 Vector2 First point
p2 Vector2 Second point
p3 Vector2 Third point
color Microsoft.Xna.Framework.Color Color to fill triangle
리턴 void

ToImage() 공개 정적인 메소드

Converts a Texture2D to an System.Drawing.Image and returns it.
public static ToImage ( this texture ) : Image
texture this Texture to convert
리턴 Image

ToSystemColor() 공개 정적인 메소드

Converts and returns a Microsoft.Xna.Framework.Color to a System.Drawing.Color.
public static ToSystemColor ( this color ) : System.Drawing.Microsoft.Xna.Framework.Color
color this Color to convert.
리턴 System.Drawing.Microsoft.Xna.Framework.Color

ToSystemRect() 공개 정적인 메소드

Converts a Microsoft.Xna.Framework.Rectangle to a System.Drawing.Rectangle and returns it.
public static ToSystemRect ( this rect ) : System.Drawing.Microsoft.Xna.Framework.Rectangle
rect this Rectangle to convert
리턴 System.Drawing.Microsoft.Xna.Framework.Rectangle

ToTexture() 공개 정적인 메소드

Converts a Image to a Texture2D and returns it.
public static ToTexture ( this image, GraphicsDevice device ) : Microsoft.Xna.Framework.Graphics.Texture2D
image this Image to convert
device GraphicsDevice Texture graphics device
리턴 Microsoft.Xna.Framework.Graphics.Texture2D

ToXnaColor() 공개 정적인 메소드

Converts and returns a System.Drawing.Color to a Microsoft.Xna.Framework.Color.
public static ToXnaColor ( this color ) : Microsoft.Xna.Framework.Color
color this Color to convert.
리턴 Microsoft.Xna.Framework.Color

ToXnaRect() 공개 정적인 메소드

Converts a System.Drawing.Rectangle to a Microsoft.Xna.Framework.Rectangle and returns it.
public static ToXnaRect ( this rect ) : Rectangle
rect this Rectangle to convert
리턴 Microsoft.Xna.Framework.Rectangle