C# Class ARCed.XnaExtensions

Afficher le fichier Open project: borisblizzard/arcreator

Méthodes publiques

Méthode Description
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.

Method Details

DrawRectangle() public static méthode

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
Résultat void

DrawRectangle() public static méthode

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
Résultat void

DrawSelectionRect() public static méthode

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
Résultat void

DrawString() public static méthode

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.
Résultat void

FillRectangle() public static méthode

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
Résultat void

FillRectangle() public static méthode

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
Résultat void

FillTriangle() public static méthode

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
Résultat void

ToImage() public static méthode

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

ToSystemColor() public static méthode

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.
Résultat System.Drawing.Microsoft.Xna.Framework.Color

ToSystemRect() public static méthode

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
Résultat System.Drawing.Microsoft.Xna.Framework.Rectangle

ToTexture() public static méthode

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
Résultat Microsoft.Xna.Framework.Graphics.Texture2D

ToXnaColor() public static méthode

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.
Résultat Microsoft.Xna.Framework.Color

ToXnaRect() public static méthode

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
Résultat Microsoft.Xna.Framework.Rectangle