Table of Contents

Class Draw

Namespace
MohawkGame2D
Assembly
GAME 10003 Game Development Foundations - 2D Game Template.dll

Access shape drawing functions.

public static class Draw
Inheritance
Draw
Inherited Members

Remarks

A static wrapper to standardize raylib's draw API.

Properties

FillColor

Shape fill color.

public static Color FillColor { get; set; }

Property Value

Color

LineColor

Line and outline color.

public static Color LineColor { get; set; }

Property Value

Color

LineSize

Line and outline size in pixels.

public static float LineSize { get; set; }

Property Value

float

Methods

ApproximateEllipseCircumference(float, float)

public static float ApproximateEllipseCircumference(float a, float b)

Parameters

a float
b float

Returns

float

Arc(Vector2, Vector2, float, float)

Draw a filled and outlined arc at position expanding outward to size from angleFrom to angleTo using LineSize for the outline thickness, LineColor for the line's color, and FillColor for the rectangle's fill Color.

public static void Arc(Vector2 position, Vector2 size, float angleFrom, float angleTo)

Parameters

position Vector2

The arc's position, defines the centre point.

size Vector2

The arc's size (width and height).

angleFrom float

Starting arc angle fill, in degrees 0-360.

angleTo float

Ending arc angle fill, in degrees 0-360.

Arc(float, float, float, float, float, float)

Draw a filled and outlined arc at position (x, y) expanding outward to size (w, h) from angleFrom to angleTo using LineSize for the outline thickness, LineColor for the line's color, and FillColor for the rectangle's fill Color.

public static void Arc(float x, float y, float w, float h, float angleFrom, float angleTo)

Parameters

x float

The arc's X position, defines the horizontal centre.

y float

The arc's Y position, defines the vertical centre.

w float

The arc's width.

h float

The arc's height.

angleFrom float

Starting arc angle fill, in degrees 0-360.

angleTo float

Ending arc angle fill, in degrees 0-360.

Capsule(Vector2, Vector2, float)

public static void Capsule(Vector2 position1, Vector2 position2, float radius)

Parameters

position1 Vector2
position2 Vector2
radius float

Capsule(float, float, float, float, float)

public static void Capsule(float x1, float y1, float x2, float y2, float radius)

Parameters

x1 float
y1 float
x2 float
y2 float
radius float

Circle(Vector2, float)

public static void Circle(Vector2 position, float radius)

Parameters

position Vector2
radius float

Circle(float, float, float)

public static void Circle(float x, float y, float radius)

Parameters

x float
y float
radius float

Ellipse(Vector2, Vector2)

public static void Ellipse(Vector2 position, Vector2 size)

Parameters

position Vector2
size Vector2

Ellipse(float, float, float, float)

public static void Ellipse(float x, float y, float w, float h)

Parameters

x float
y float
w float
h float

Line(Vector2, Vector2)

public static void Line(Vector2 start, Vector2 end)

Parameters

start Vector2
end Vector2

Line(float, float, float, float)

public static void Line(float x1, float y1, float x2, float y2)

Parameters

x1 float
y1 float
x2 float
y2 float

LineSharp(Vector2, Vector2)

public static void LineSharp(Vector2 start, Vector2 end)

Parameters

start Vector2
end Vector2

LineSharp(float, float, float, float)

public static void LineSharp(float x1, float y1, float x2, float y2)

Parameters

x1 float
y1 float
x2 float
y2 float

PolyLine(int[], int[])

public static void PolyLine(int[] xCoordinates, int[] yCoordinates)

Parameters

xCoordinates int[]
yCoordinates int[]

PolyLine(params Vector2[])

public static void PolyLine(params Vector2[] points)

Parameters

points Vector2[]

PolyLine(float[], float[])

public static void PolyLine(float[] xCoordinates, float[] yCoordinates)

Parameters

xCoordinates float[]
yCoordinates float[]

Polygon(Vector2, float, int, float, PolygoneMode)

public static void Polygon(Vector2 position, float radius, int edgeCount, float rotation, PolygoneMode mode)

Parameters

position Vector2
radius float
edgeCount int
rotation float
mode PolygoneMode

Polygon(float, float, float, int, float, PolygoneMode)

public static void Polygon(float x, float y, float radius, int edgeCount, float rotation, PolygoneMode mode)

Parameters

x float
y float
radius float
edgeCount int
rotation float
mode PolygoneMode

Quad(Vector2, Vector2, Vector2, Vector2)

public static void Quad(Vector2 position1, Vector2 position2, Vector2 position3, Vector2 position4)

Parameters

position1 Vector2
position2 Vector2
position3 Vector2
position4 Vector2

Quad(float, float, float, float, float, float, float, float)

public static void Quad(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)

Parameters

x1 float
y1 float
x2 float
y2 float
x3 float
y3 float
x4 float
y4 float

Rectangle(Vector2, Vector2)

public static void Rectangle(Vector2 position, Vector2 size)

Parameters

position Vector2
size Vector2

Rectangle(float, float, float, float)

public static void Rectangle(float x, float y, float w, float h)

Parameters

x float
y float
w float
h float

Square(Vector2, float)

public static void Square(Vector2 position, float size)

Parameters

position Vector2
size float

Square(float, float, float)

public static void Square(float x, float y, float size)

Parameters

x float
y float
size float

Triangle(Vector2, Vector2, Vector2)

public static void Triangle(Vector2 position1, Vector2 position2, Vector2 position3)

Parameters

position1 Vector2
position2 Vector2
position3 Vector2

Triangle(float, float, float, float, float, float)

public static void Triangle(float x1, float y1, float x2, float y2, float x3, float y3)

Parameters

x1 float
y1 float
x2 float
y2 float
x3 float
y3 float