C# Class Danmaku_no_Kyojin.Utils.Primitives2D

显示文件 Open project: Noxalus/Danmaku-no-Kyojin

Public Methods

Method Description
DrawArc ( this spriteBatch, Vector2 center, float radius, int sides, float startingAngle, float radians, Color color ) : void

Draw a arc

DrawArc ( this spriteBatch, Vector2 center, float radius, int sides, float startingAngle, float radians, Color color, float thickness ) : void

Draw a arc

DrawCircle ( this spriteBatch, Vector2 center, float radius, int sides, Color color ) : void

Draw a circle

DrawCircle ( this spriteBatch, Vector2 center, float radius, int sides, Color color, float thickness ) : void

Draw a circle

DrawCircle ( this spriteBatch, float x, float y, float radius, int sides, Color color ) : void

Draw a circle

DrawCircle ( this spriteBatch, float x, float y, float radius, int sides, Color color, float thickness ) : void

Draw a circle

DrawLine ( this spriteBatch, Vector2 point1, Vector2 point2, Color color ) : void

Draws a line from point1 to point2 with an offset

DrawLine ( this spriteBatch, Vector2 point1, Vector2 point2, Color color, float thickness ) : void

Draws a line from point1 to point2 with an offset

DrawLine ( this spriteBatch, Vector2 point, float length, float angle, Color color ) : void

Draws a line from point1 to point2 with an offset

DrawLine ( this spriteBatch, Vector2 point, float length, float angle, Color color, float thickness ) : void

Draws a line from point1 to point2 with an offset

DrawLine ( this spriteBatch, float x1, float y1, float x2, float y2, Color color ) : void

Draws a line from point1 to point2 with an offset

DrawLine ( this spriteBatch, float x1, float y1, float x2, float y2, Color color, float thickness ) : void

Draws a line from point1 to point2 with an offset

DrawRectangle ( this spriteBatch, Rectangle rect, Color color ) : void

Draws a rectangle with the thickness provided

DrawRectangle ( this spriteBatch, Rectangle rect, Color color, float thickness ) : void

Draws a rectangle with the thickness provided

DrawRectangle ( this spriteBatch, Vector2 location, Vector2 size, Color color ) : void

Draws a rectangle with the thickness provided

DrawRectangle ( this spriteBatch, Vector2 location, Vector2 size, Color color, float thickness ) : void

Draws a rectangle with the thickness provided

FillRectangle ( this spriteBatch, Rectangle rect, Color color ) : void

Draws a filled rectangle

FillRectangle ( this spriteBatch, Rectangle rect, Color color, float angle ) : void

Draws a filled rectangle

FillRectangle ( this spriteBatch, Vector2 location, Vector2 size, Color color ) : void

Draws a filled rectangle

FillRectangle ( this spriteBatch, Vector2 location, Vector2 size, Color color, float angle ) : void

Draws a filled rectangle

FillRectangle ( this spriteBatch, float x, float y, float w, float h, Color color ) : void

Draws a filled rectangle

FillRectangle ( this spriteBatch, float x, float y, float w, float h, Color color, float angle ) : void

Draws a filled rectangle

PutPixel ( this spriteBatch, Vector2 position, Color color ) : void
PutPixel ( this spriteBatch, float x, float y, Color color ) : void

Private Methods

Method Description
CreateArc ( float radius, int sides, float startingAngle, float radians ) : List

Creates a list of vectors that represents an arc

CreateCircle ( double radius, int sides ) : List

Creates a list of vectors that represents a circle

CreateThePixel ( SpriteBatch spriteBatch ) : void
DrawPoints ( SpriteBatch spriteBatch, Vector2 position, List points, Color color, float thickness ) : void

Draws a list of connecting points

Method Details

DrawArc() public static method

Draw a arc
public static DrawArc ( this spriteBatch, Vector2 center, float radius, int sides, float startingAngle, float radians, Color color ) : void
spriteBatch this The destination drawing surface
center Vector2 The center of the arc
radius float The radius of the arc
sides int The number of sides to generate
startingAngle float The starting angle of arc, 0 being to the east, increasing as you go clockwise
radians float The number of radians to draw, clockwise from the starting angle
color Color The color of the arc
return void

DrawArc() public static method

Draw a arc
public static DrawArc ( this spriteBatch, Vector2 center, float radius, int sides, float startingAngle, float radians, Color color, float thickness ) : void
spriteBatch this The destination drawing surface
center Vector2 The center of the arc
radius float The radius of the arc
sides int The number of sides to generate
startingAngle float The starting angle of arc, 0 being to the east, increasing as you go clockwise
radians float The number of radians to draw, clockwise from the starting angle
color Color The color of the arc
thickness float The thickness of the arc
return void

DrawCircle() public static method

Draw a circle
public static DrawCircle ( this spriteBatch, Vector2 center, float radius, int sides, Color color ) : void
spriteBatch this The destination drawing surface
center Vector2 The center of the circle
radius float The radius of the circle
sides int The number of sides to generate
color Color The color of the circle
return void

DrawCircle() public static method

Draw a circle
public static DrawCircle ( this spriteBatch, Vector2 center, float radius, int sides, Color color, float thickness ) : void
spriteBatch this The destination drawing surface
center Vector2 The center of the circle
radius float The radius of the circle
sides int The number of sides to generate
color Color The color of the circle
thickness float The thickness of the lines used
return void

DrawCircle() public static method

Draw a circle
public static DrawCircle ( this spriteBatch, float x, float y, float radius, int sides, Color color ) : void
spriteBatch this The destination drawing surface
x float The center X of the circle
y float The center Y of the circle
radius float The radius of the circle
sides int The number of sides to generate
color Color The color of the circle
return void

DrawCircle() public static method

Draw a circle
public static DrawCircle ( this spriteBatch, float x, float y, float radius, int sides, Color color, float thickness ) : void
spriteBatch this The destination drawing surface
x float The center X of the circle
y float The center Y of the circle
radius float The radius of the circle
sides int The number of sides to generate
color Color The color of the circle
thickness float The thickness of the lines used
return void

DrawLine() public static method

Draws a line from point1 to point2 with an offset
public static DrawLine ( this spriteBatch, Vector2 point1, Vector2 point2, Color color ) : void
spriteBatch this The destination drawing surface
point1 Vector2 The first point
point2 Vector2 The second point
color Color The color to use
return void

DrawLine() public static method

Draws a line from point1 to point2 with an offset
public static DrawLine ( this spriteBatch, Vector2 point1, Vector2 point2, Color color, float thickness ) : void
spriteBatch this The destination drawing surface
point1 Vector2 The first point
point2 Vector2 The second point
color Color The color to use
thickness float The thickness of the line
return void

DrawLine() public static method

Draws a line from point1 to point2 with an offset
public static DrawLine ( this spriteBatch, Vector2 point, float length, float angle, Color color ) : void
spriteBatch this The destination drawing surface
point Vector2 The starting point
length float The length of the line
angle float The angle of this line from the starting point in radians
color Color The color to use
return void

DrawLine() public static method

Draws a line from point1 to point2 with an offset
public static DrawLine ( this spriteBatch, Vector2 point, float length, float angle, Color color, float thickness ) : void
spriteBatch this The destination drawing surface
point Vector2 The starting point
length float The length of the line
angle float The angle of this line from the starting point
color Color The color to use
thickness float The thickness of the line
return void

DrawLine() public static method

Draws a line from point1 to point2 with an offset
public static DrawLine ( this spriteBatch, float x1, float y1, float x2, float y2, Color color ) : void
spriteBatch this The destination drawing surface
x1 float The X coord of the first point
y1 float The Y coord of the first point
x2 float The X coord of the second point
y2 float The Y coord of the second point
color Color The color to use
return void

DrawLine() public static method

Draws a line from point1 to point2 with an offset
public static DrawLine ( this spriteBatch, float x1, float y1, float x2, float y2, Color color, float thickness ) : void
spriteBatch this The destination drawing surface
x1 float The X coord of the first point
y1 float The Y coord of the first point
x2 float The X coord of the second point
y2 float The Y coord of the second point
color Color The color to use
thickness float The thickness of the line
return void

DrawRectangle() public static method

Draws a rectangle with the thickness provided
public static DrawRectangle ( this spriteBatch, Rectangle rect, Color color ) : void
spriteBatch this The destination drawing surface
rect Microsoft.Xna.Framework.Rectangle The rectangle to draw
color Color The color to draw the rectangle in
return void

DrawRectangle() public static method

Draws a rectangle with the thickness provided
public static DrawRectangle ( this spriteBatch, Rectangle rect, Color color, float thickness ) : void
spriteBatch this The destination drawing surface
rect Microsoft.Xna.Framework.Rectangle The rectangle to draw
color Color The color to draw the rectangle in
thickness float The thickness of the lines
return void

DrawRectangle() public static method

Draws a rectangle with the thickness provided
public static DrawRectangle ( this spriteBatch, Vector2 location, Vector2 size, Color color ) : void
spriteBatch this The destination drawing surface
location Vector2 Where to draw
size Vector2 The size of the rectangle
color Color The color to draw the rectangle in
return void

DrawRectangle() public static method

Draws a rectangle with the thickness provided
public static DrawRectangle ( this spriteBatch, Vector2 location, Vector2 size, Color color, float thickness ) : void
spriteBatch this The destination drawing surface
location Vector2 Where to draw
size Vector2 The size of the rectangle
color Color The color to draw the rectangle in
thickness float The thickness of the line
return void

FillRectangle() public static method

Draws a filled rectangle
public static FillRectangle ( this spriteBatch, Rectangle rect, Color color ) : void
spriteBatch this The destination drawing surface
rect Microsoft.Xna.Framework.Rectangle The rectangle to draw
color Color The color to draw the rectangle in
return void

FillRectangle() public static method

Draws a filled rectangle
public static FillRectangle ( this spriteBatch, Rectangle rect, Color color, float angle ) : void
spriteBatch this The destination drawing surface
rect Microsoft.Xna.Framework.Rectangle The rectangle to draw
color Color The color to draw the rectangle in
angle float The angle in radians to draw the rectangle at
return void

FillRectangle() public static method

Draws a filled rectangle
public static FillRectangle ( this spriteBatch, Vector2 location, Vector2 size, Color color ) : void
spriteBatch this The destination drawing surface
location Vector2 Where to draw
size Vector2 The size of the rectangle
color Color The color to draw the rectangle in
return void

FillRectangle() public static method

Draws a filled rectangle
public static FillRectangle ( this spriteBatch, Vector2 location, Vector2 size, Color color, float angle ) : void
spriteBatch this The destination drawing surface
location Vector2 Where to draw
size Vector2 The size of the rectangle
color Color The color to draw the rectangle in
angle float The angle in radians to draw the rectangle at
return void

FillRectangle() public static method

Draws a filled rectangle
public static FillRectangle ( this spriteBatch, float x, float y, float w, float h, Color color ) : void
spriteBatch this The destination drawing surface
x float The X coord of the left side
y float The Y coord of the upper side
w float Width
h float Height
color Color The color to draw the rectangle in
return void

FillRectangle() public static method

Draws a filled rectangle
public static FillRectangle ( this spriteBatch, float x, float y, float w, float h, Color color, float angle ) : void
spriteBatch this The destination drawing surface
x float The X coord of the left side
y float The Y coord of the upper side
w float Width
h float Height
color Color The color to draw the rectangle in
angle float The angle of the rectangle in radians
return void

PutPixel() public static method

public static PutPixel ( this spriteBatch, Vector2 position, Color color ) : void
spriteBatch this
position Vector2
color Color
return void

PutPixel() public static method

public static PutPixel ( this spriteBatch, float x, float y, Color color ) : void
spriteBatch this
x float
y float
color Color
return void