Table of Contents

Interface ICanvas

Namespace
BOOSE
Assembly
BOOSE.dll

Implement ICanvas for your BOOSE renderer. It has an Xpos and Ypos of the current cursor position, and a pen colour. Your class should implement the methods below to draw on its "bitmap" (i.e. it may not be a bitmap, it could draw in ASCII text for example).

public interface ICanvas

Properties

PenColour

Get/Set the Pencolour for next drawing operation using a native colour datatype. Cast to relevant type.

object PenColour { get; set; }

Property Value

object

Xpos

X position of next drawing operation.

int Xpos { get; set; }

Property Value

int

Ypos

Y position of next drawing position

int Ypos { get; set; }

Property Value

int

Methods

Circle(int, bool)

Draw a circle at cursor position of radius.

void Circle(int radius, bool filled)

Parameters

radius int

Radius of circle.

filled bool

If True circle is drawn filled, outline if false.

Clear()

Fill the background in the default colour.

void Clear()

DrawTo(int, int)

Draw a line using the current pen from the last drawingf position to the specified position and move the cursor position to the provided x,y

void DrawTo(int x, int y)

Parameters

x int

specified X position.

y int

specified Y position.

MoveTo(int, int)

Move the X and Y of the next drawing operation.

void MoveTo(int x, int y)

Parameters

x int

X position of cursor.

y int

Y position of cursor.

Rect(int, int, bool)

Draw a rectangle at cursor position of width and height.

void Rect(int width, int height, bool filled)

Parameters

width int
height int
filled bool

Reset()

Reset drawing cursor to 0,0 and reset pen to default.

void Reset()

Set(int, int)

Set output display size. This method should create whatever drawing display you intend to use of the size specified.

void Set(int width, int height)

Parameters

width int
height int

SetColour(int, int, int)

Set the pen colour using rgb values.

void SetColour(int red, int green, int blue)

Parameters

red int
green int
blue int

Tri(int, int)

Draw a triangle in the bounding rectangle.

void Tri(int width, int height)

Parameters

width int

Width of bounding rectangle.

height int

Height of bounding rectangle.

WriteText(string)

Draws text on the output window at the cursor position

void WriteText(string text)

Parameters

text string

String to output

getBitmap()

Get the drawing Object of whatever native type. Returned a Object so it can be cast to native type. Use this to get native drawing type so that it can be displayed or output.

object getBitmap()

Returns

object