diff --git a/JoeyLib-Drawing-Functions.md b/JoeyLib-Drawing-Functions.md new file mode 100644 index 0000000..6a70f78 --- /dev/null +++ b/JoeyLib-Drawing-Functions.md @@ -0,0 +1,61 @@ +*All drawing operations take place on a "back buffer" and not on the visible display. To make any content visible, you must call `jlDisplayPresent()`.* + +#### jlDrawBlit8x8 +```c +void jlDrawBlit8x8(jlStaT *sta, int cx1, int cy1, int cx2, int cy2); +``` +"Blits" (rapidly copies) an 8x8 pixel "tile" from a loaded static image onto the back buffer. The coordinates of the tile to blit are specified in "cells". With the display being 320x200 pixels, there are 40x24 cells per image/display. + +#### jlDrawBox +```c +void jlDrawBox(int x1, int y1, int x2, int y2); +``` +Draws a hollow rectangle from (x1, y1) to (x2, y2). + +#### jlDrawBoxFilled +```c +void jlDrawBoxFilled(int x1, int y1, int x2, int y2); +``` +Draws a hollow rectangle from (x1, y1) to (x2, y2). + +#### jlDrawClear +```c +void jlDrawClear(void); +``` +Clears the back buffer to the current draw color. + +#### jlDrawColor +```c +void jlDrawColor(byte index); +``` +Specifies the color to use for the following draw functions. Colors are specified by their index position in the current palette. + +#### jlDrawFill +```c +void jlDrawFill(int x, int y); +``` +Performs a flood fill from the given coordinates. The fill will continue as long as it occupies the same color as the starting point. + +#### jlDrawFillTo +```c +void jlDrawFillTo(int x, int y, byte color); +``` +Performs a flood fill from the given coordinates. The fill will continue until it encounters pixels of `color`. + +#### jlDrawGetPixel +```c +byte jlDrawGetPixel(int x, int y); +``` +Returns the color index of the specified pixel. + +#### jlDrawLine +```c +void jlDrawLine(int x1, int y1, int x2, int y2); +``` +Draws a line from (x1, y1) to (x2, y2). + +#### jlDrawPoint +```c +void jlDrawPoint(int x, int y); +``` +Draws a single point at location (x, y). \ No newline at end of file