Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Submit feedback
  • Sign in
joeylib
joeylib
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 11
    • Issues 11
    • List
    • Boards
    • Labels
    • Milestones
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Public Skunkworks
  • joeylibjoeylib
  • Wiki
  • JoeyLib Drawing Functions

JoeyLib Drawing Functions

Last edited by Scott Duensing Oct 17, 2019
Page history

jlDrawBlit8x8

void jlDrawBlit8x8(jlSurfaceT source, jint16 sx, jint16 sy, jint16 tx, jint16 ty);

"Blits" (rapidly copies) an 8x8 pixel "tile" from the specified surface onto the current drawing surface. The coordinates of the tile to blit (sx, sy) are specified in 8x8 "cells". (With the display being 320x200 pixels, there are 40x24 cells per surface.) Target coordinates (tx, ty) are specified in pixels. Due to the way display memory is handled, blitting to odd columns is very slow. Requesting an odd column target will result in the tile being blitted to the previous even column. If you need single pixel horizontal accuracy, create a second set of tiles with the content offset by one pixel and alternate between them.

jlDrawBlit8x8a

void jlDrawBlit8x8a(jlSurfaceT source, jint16 sx, jint16 sy, jint16 tx, jint16 ty, byte offset);

"Blits" (rapidly copies) an 8x8 pixel "tile" from the specified surface onto the current drawing surface with transparency. This call is slower than jlDrawBlit8x8, so use only when needed. The coordinates of the tile to blit (sx, sy) are specified in 8x8 "cells". (With the display being 320x200 pixels, there are 40x24 cells per surface.) Target coordinates (tx, ty) are specified in pixels. Due to the way display memory is handled, blitting to odd columns is very slow. Requesting an odd column target will result in the tile being blitted to the previous even column. If you need single pixel horizontal accuracy, create a second set of tiles with the content offset by one pixel and alternate between them. Transparency information is contained in a "mask" tile that is located offset cells to the right of the specified tile. If the pixel in the mask is color 0, the corresponding pixel in the source tile will be copied to the current surface. If the mask pixel is color 15, nothing will be copied. Other mask color values are undefined and should not be used.

jlDrawBlitMap

void jlDrawBlitMap(jint16 startX, jint16 startY, jint16 width, jint16 height, byte *mapData, juint16 stride, jlSurfaceT source);

Allows rapid blitting of a pre-defined arrangement of tiles to the current drawing surface. startX and startY define the upper right hand location of the destination in pixels. width and height define the destinations dimensions in cells (8x8 pixel blocks). mapData is a pointer to a block of memory containing a stream of bytes representing the source tiles X and Y location (one byte X, one byte Y per tile). To allow drawing a sub-section of the tile data, after width tiles have been blitted, stride bytes will be skipped in the mapData before the next row begins.

jlDrawBox

void jlDrawBox(jint16 x1, jint16 y1, jint16 x2, jint16 y2);

Draws a hollow rectangle from (x1, y1) to (x2, y2).

jlDrawBoxFilled

void jlDrawBoxFilled(jint16 x1, jint16 y1, jint16 x2, jint16 y2);

Draws a hollow rectangle from (x1, y1) to (x2, y2).

jlDrawCircle

void jlDrawCircle(jint16 x, jint16 y, jint16 radius);

Draws a circle of the given size at the given coordinates. Unlike the majority of drawing routines, a portion of the circle may extend off the screen and will be clipped. Clipped circles are much slower to draw.

jlDrawClear

void jlDrawClear(void);

Clears the back buffer to the current draw color.

jlDrawColorGet

byte jlDrawColorGet(void);

Returns the index of the currently specified drawing color.

jlDrawColorSet

void jlDrawColorSet(byte index);

Specifies the color to use for the following draw functions. Colors are specified by their index position in the current palette.

jlDrawEllipse

void jlDrawEllipse(jint16 x1, jint16 y1, jint16 x2, jint16 y2);

Draws an ellipse that fills the box represented by (x1, y1) to (x2, y2).

jlDrawFill

void jlDrawFill(jint16 x, jint16 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

void jlDrawFillTo(jint16 x, jint16 y, byte color);

Performs a flood fill from the given coordinates. The fill will continue until it encounters pixels of color.

jlDrawLine

void jlDrawLine(jint16 x1, jint16 y1, jint16 x2, jint16 y2);

Draws a line from (x1, y1) to (x2, y2).

jlDrawPixelGet

byte jlDrawPixelGet(jint16 x, jint16 y);

Returns the color index of the specified pixel.

jlDrawPixelSet

void jlDrawPixelSet(jint16 x, jint16 y);

Draws a single point at location (x, y).

jlDrawSurfaceGet

jlSurfaceT jlDrawSurfaceGet(void);

Returns a pointer to the current drawing surface.

jlDrawSurfaceSet

void jlDrawSurfaceSet(jlSurfaceT target);

Specifies the drawing surface for all drawing functions to use as a target. To draw to the display back buffer itself, use JOEY_DISPLAY as the target.

Clone repository
  • Installation
  • JoeyLib API
  • JoeyLib Concepts
  • JoeyLib Data Types
  • JoeyLib Definitions
  • JoeyLib Display Functions
  • JoeyLib Drawing Functions
  • JoeyLib Enumerations
  • JoeyLib Formats
  • JoeyLib Gamepad Functions
  • JoeyLib Keyboard Functions
  • JoeyLib Memory Functions
  • JoeyLib Palette Functions
  • JoeyLib Sound Functions
  • JoeyLib Static Image Functions
View All Pages