Riko4
Jump to navigation
Jump to search
This article is incomplete. You can help this wiki by expanding it.
Riko4 is a fantasy computer first released in 2017 by Emma. Games and applications written for Riko4 using Lua.
Specifications
- Screen: 280x160, 16 color fixed palette
- Sound: yes
API
Riko4 has a few functions built-in that are called by the system.
_update()
- Called every frame before_draw()
_draw()
- Called every frame after_update()
_event(evt, ...)
- Called when an event is created
Console Commands
cd [folder]
ls
lua
Graphics
Many of these are wrapper functions for the GPU module.
cam(x, y)
- move the cameracls()
line(x1, y1, x2, y2, color, lineWidth)
pal(paletteTable)
pget(x, y)
pix(x, y, color)
pixb(centerX, centerY, width, height, pixelTable)
- blit pixelspop()
push()
rgb(red, blue, green)
- creates an RGB valuerect(x, y, width, height, color)
rectFill(x, y, width, height, color)
sheet(file, area, spacing, margin)
spr(x, y, dx, dy)
swap()
trans(x, y)
write(text, width, height, color)
writeScaled(text, width, height, color)
?writeWidth(text, width)
?
GPU
gpu.blitPalette(palette)
gpu.blitPixels(centerX, centerY, width, height, pixelTable)
gpu.clear(color)
gpu.clip(x, y, width, height)
gpu.drawPixel(x, y, color)
gpu.drawRectangle(x, y, width, height, color)
gpu.getPalette()
gpu.getPixel(x, y)
gpu.pop()
gpu.push()
gpu.translate(x, y)
gpu.setPaletteColor(index, r, g, b)
gpu.swap()
Filesystem
FSRef:close()
- close the file handle FSRefbool fs.delete(filename)
fs.getAttr(filename)
fs.getCWD()
fs.getClipboard()
fs.getLastFile()
fs.list(directory)
bool fs.mkdir(folderName)
- Creates folderName with 0777 maskbool fs.move(originalFilename, destFilename)
FSRef = fs.open(filename, flags)
- opens a file handle (must also be closed manually)FSRef:read(someWeirdKeyword)
fs.setClipboard(text)
fs.setCWD(directory)
Sound
speaker.play(params)