Skip to main content

PICO-8 Style API (deprecated)

A set of functions provided for convenience to users coming from PICO-8.

danger

Those functions are deprecated and will be removed in a future release.

fget

Get the state of a specific flag

isSet = fget(spriteId, flagPosition)
ParameterTypeDefaultNote
spriteIdnumber⚠️ required
flagPositionnumber⚠️ requiredan integer in range [1, 8].
ReturnTypeNote
isSetboolean

Get all the flags state in binary

bitfield = fget(spriteId)
ParameterTypeDefaultNote
spriteIdnumber⚠️ required
ReturnTypeNote
bitfieldnumber

fset

Set the state of a specific flag

fset(spriteId, flagPosition, state)
ParameterTypeDefaultNote
spriteIdnumber⚠️ required
flagPositionnumber⚠️ required
stateboolean⚠️ required

Set the state of all the flags in binary

fset(spriteId, bitfield)
ParameterTypeDefaultNote
spriteIdnumber⚠️ required
bitfieldnumber⚠️ required

pget

Get the color of a pixel on the screen.

colorId = pget(x, y)
ParameterTypeDefaultNote
xnumber⚠️ required
ynumber⚠️ required
ReturnTypeNote
colorIdnumberan integer in range [0, 15]

pset

Set the color of a pixel on the screen.

pset(x, y, colorId)
ParameterTypeDefaultNote
xnumber⚠️ required
ynumber⚠️ required
colorIdnumber⚠️ requiredan integer in range [0, 15]

sget

Get the color of a pixel form the sprites.

colorId = sget(x, y)
ParameterTypeDefaultNote
xnumber⚠️ required
ynumber⚠️ required
ReturnTypeNote
colorIdnumberan integer in range [0, 15]

sset

Set the color of a pixel in the sprites.

sset(x, y, colorId)
ParameterTypeDefaultNote
xnumber⚠️ required
ynumber⚠️ required
colorIdnumber⚠️ requiredan integer in range [0, 15]

mget

Get the id of the sprite for a cell in the map.

spriteId = mget(x, y)
ParameterTypeDefaultNote
xnumber⚠️ requiredin cells.
ynumber⚠️ requiredin cells.
ReturnTypeNote
spriteIdnumber

mset

Set the sprite for a cell in the map.

mset(x, y, spriteId)
ParameterTypeDefaultNote
xnumber⚠️ required
ynumber⚠️ required
spriteIdnumber⚠️ required