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
Xpos
X position of next drawing operation.
int Xpos { get; set; }
Property Value
Ypos
Y position of next drawing position
int Ypos { get; set; }
Property Value
Methods
Circle(int, bool)
Draw a circle at cursor position of radius.
void Circle(int radius, bool filled)
Parameters
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
MoveTo(int, int)
Move the X and Y of the next drawing operation.
void MoveTo(int x, int y)
Parameters
Rect(int, int, bool)
Draw a rectangle at cursor position of width and height.
void Rect(int width, int height, bool filled)
Parameters
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
SetColour(int, int, int)
Set the pen colour using rgb values.
void SetColour(int red, int green, int blue)
Parameters
Tri(int, int)
Draw a triangle in the bounding rectangle.
void Tri(int width, int height)
Parameters
WriteText(string)
Draws text on the output window at the cursor position
void WriteText(string text)
Parameters
text
stringString 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()