Unicorn Console is a quick and dirty engine that let you do what you want with a resolution of 400x240 pixels. The main engine is not dependant of a specific GFX library so you can use it where you want:
TOC:
Cargo feature:
You can choose to build the main UI to play/edit games:
cd unicorn-devkit
cargo build --release
and run it with the default embedded game:
./target/release/uc-devkit
or load an existing one:
./target/release/uc-devkit ../unicorn/games/floppybird/floppybird.uni
You can also choose to build the libretro version:
cd unicorn-libretro
cargo build --release
And load the shared library with retroarch:
retroarch -L target/release/libunicorn_libretro.so ../unicorn/examples/api_demos.uni
The API is available for Rust/Javascript/Python/Lua.
camera([x, y])
Set the camera position.
circ(x, y, r, [col])
Draw a circle:
circfill(x, y, r, [col])
Draw a filled circle:
[[https://j.gifs.com/nZl3GE.gif]]
clip([x, y, w, h])
Set a screen clipping region where:
Clear the screen.
color(col)
set default color
ellipse(x, y, rx, ry, [col])
Draw an ellipse
ellipsefill(x, y, rx, ry, [col])
draw filled ellipse
fget(n, [f])
get values of sprite flags
font(name)
Change the font policy ("pico8", "bbc", "cbmII", "appleII")
fset(n, [f], v)
set values of sprite flags
line(x0, y0, x1, y1, [col])
draw line
pal(c0, c1)
Switch the color c0 to color c1.
palt(col, t)
Set the transparency for color 'col', where 't' is a boolean
pget(x, y)
Get the pixel color in x/y coordinate
print (str, [x, y, [col]])
[Python: unicorn_print]
Display a string on the screen
pset(x, y, col)
Set the pixel color with the value 'col' in x/y coordinate
rect(x0, y0, x1, y1, [col])
draw a rectangle
rectfill(x0, y0, x1, y1, [col])
draw filled rectangle
[[https://j.gifs.com/76MGDr.gif]]
sget(x, y)
get spritesheet pixel colour
spr(n, x, y, [w, h], [flip_x], [flip_y])
Draw a sprite:
Color 0 will be transparent by default (see palt
sset(x, y, [col])
set spritesheet pixel colour
sspr(sx, sy, sw, sh, dx, dy, [dw, dh], [flip_x], [flip_y])
draw texture from spritesheet
trigon(x1, y1, x2, y2, x3, y3, [col])
draw trigon
get button i state for player p
only true when the button was not pressed the last frame; repeats every 4 frames after button held for 15 frames
map(cel_x, cel_y, sx, sy, cel_w, cel_h, [layer])
[Python: spr_map]
Draw map; layers from flags; sprite 0 is empty
mget(x, y)
Get a map value
mset(x, y, v)
Set a map value
noise(x, y, z)
noise_set_seed(x)