Skip to content

Instantly share code, notes, and snippets.

@incinirate
incinirate / LuaXML.lua
Last active June 1, 2017 22:22
Simple parser / pretty printer for XML written in Lua, no guarentees about anything
local xmlutils = {}
--[[
TODO:
- Parse standard XML header
]]

Riko 4

Graphics Interface Specs

Good practices

    Generally, the fastest way to handle graphics in Riko 4 is to rasterize everything into an image (see below) to reduce calls. However this is not always applicable as creating images is not super fast. Meaning, its not a good idea to create new images every frame. You can modify images which is a good way to make minor changes to them, however the ideal condition is to have a spritesheet with all possible forms of your graphics present.

    As the Riko 4 screen is double buffered, the ideal way to draw graphics is to clear the screen, draw your graphics, then swap.


@incinirate
incinirate / scrollbar.lua
Created July 12, 2016 16:44
The core for scrollbar system in CC
--[[
Given the height of the associated work area, and the height of the viewport you can create a scrollbar where the entirety
of it's scope represents the entire document, where the size of the handle represents the viewport. The problem comes in when
the document is so long, that the linked scroll handle would be too small. The way to solve that problem is to simply have a
minimum length for the handle, The logic will still stay the same since the defines of the area is enclosed by the top of the
scroll handle. And when the handle reaches the very bottom, then you can adjust so that the bottom of the document is viewed.
]]