Drawing Commands
(color)
clearClears the entire screen to color
, which can be a number from 0-127.
Numbers from 0 up to 15 are in the first palette, 16-31 in the second etc.
(x, y, sprite_x, sprite_y, palette)
spriteWARNING:
sprite_x
,sprite_y
are NOT in pixels. They are in sprites, which are 16x16.
Draws a sprite found in the spritesheet at sprite_x
, sprite_y
in the screen
at x
, y
.
The palette
is optional and defaults to 0 (the first palette).
(x, y, sheet_x, sheet_y, sprite_w, sprite_h, palette)
custom_spriteWARNING:
sheet_x
andsheet_y
are in pixels.
Draws a custom sized sprite measuring sprite_w
by sprite_h
from the
sheet_x
, sheet_y
position in the spritesheet to x
,y
in the screen.
The palette
is optional and defaults to 0 (the first palette).
(text, x, y, palette)
printDraws text
at x
, y
using (optionally) palette
.
(text)
measureReturns the width that text
would have if printed to the screen.
(file_name)
start_recordingStart recording the screen to file_name
.
()
stop_recordingStops the current recording.
(x, y)
get_pixelReturns the color of a pixel in the screen.
(x, y, color)
put_pixelSets the color of a pixel in the screen.
(x, y, w, h)
clipClip all drawing operations to the specified region of the screen.
(x, y, w, h, color)
fill_rectDraws a filled rectangle with color
at x
, y
, of size w
xh
.
(x, y, radius, color)
fill_circDraws a filled circle with color
at x
, y
, of radius radius
.
(x1, y1, x2, y2, x3, y3, color)
fill_triDraws a triangle with color
and the points (x1
, y1
), (x2
, y2
), (x3
, y3
).
(x1, y1, x2, y2, x3, y3, x4, y4, color)
fill_quadDraws a quad with color
and the points (x1
, y1
), (x2
, y2
), (x3
,
y3
), (x4
, y4
).
(x1, y1, x2, y2, color)
lineDraws a line between the two points with color
.
(x, y, w, h, color)
rectSame as fill_rect
but writeframe only.
(x, y, radius, color)
circSame as fill_circ
but writeframe only.
(x1, y1, x2, y2, x3, y3, color)
triSame as fill_tri
but writeframe only.
(x1, y1, x2, y2, x3, y3, x4, y4, color)
fill_quadSame as fill_quad
but writeframe only.
(x, y, w, h, hot_x, hot_y, pal)
mouse_cursorSets the area defined by x
, y
, w
, h
as the native cursor when running in
emulator mode. Uses palette pal
or defaults to 0.
This allows for a low-latency perception of input even at 30fps.
hot_x
and hot_y
are the coordinates inside the selected sprite region that
will be aligned with the actual cursor. Defaults to 0, 0
.