Riko4: Difference between revisions

From Fantasy Console Wiki
Jump to navigation Jump to search
(+language, +cat)
m (→‎Console Commands: left an empty bullet)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{stub}}
{{stub}}


'''Riko4''' is a fantasy computer first released in 2017 by Emma. Games and applications written for Riko4 using Lua.
'''Riko4''' is a fantasy computer first released in 2017 by [https://github.com/emmachase Emma]. Games and applications written for Riko4 using Lua.


==Specifications==
==Specifications==
Line 18: Line 18:
* <code>ls</code>
* <code>ls</code>
* <code>lua</code>
* <code>lua</code>
* <code></code>


===Graphics===
===Graphics===
Line 79: Line 78:
* [https://github.com/emmachase/Riko4 GitHub]
* [https://github.com/emmachase/Riko4 GitHub]


[[FCs that support Lua]]
[[Category:FCs that support Lua]]

Latest revision as of 13:36, 1 December 2023

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[edit]

  • Screen: 280x160, 16 color fixed palette
  • Sound: yes

API[edit]

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[edit]

  • cd [folder]
  • ls
  • lua

Graphics[edit]

Many of these are wrapper functions for the GPU module.

  • cam(x, y) - move the camera
  • cls()
  • line(x1, y1, x2, y2, color, lineWidth)
  • pal(paletteTable)
  • pget(x, y)
  • pix(x, y, color)
  • pixb(centerX, centerY, width, height, pixelTable) - blit pixels
  • pop()
  • push()
  • rgb(red, blue, green) - creates an RGB value
  • rect(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[edit]

  • 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[edit]

  • FSRef:close() - close the file handle FSRef
  • bool fs.delete(filename)
  • fs.getAttr(filename)
  • fs.getCWD()
  • fs.getClipboard()
  • fs.getLastFile()
  • fs.list(directory)
  • bool fs.mkdir(folderName) - Creates folderName with 0777 mask
  • bool 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[edit]

  • speaker.play(params)

Links[edit]