This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--# Hook | |
local s_setup | |
debug.sethook(function(event) | |
if setup and setup ~= s_setup then | |
local o_setup = setup | |
setup = function() | |
debug.sethook() | |
if hook then hook() end | |
o_setup() | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--# Color | |
-- modified version from https://github.com/EmmanuelOga/columns/blob/master/utils/color.lua | |
--[[ | |
* Converts an RGB color value to HSL. Conversion formula | |
* adapted from http://en.wikipedia.org/wiki/HSL_color_space. | |
* Assumes r, g, and b are contained in the set [0, 255] and | |
* returns h, s, and l in the set [0, 1]. | |
* | |
* @param Number r The red color value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--# Main | |
-------------------------------------------------------------- NAMESPACES | |
local Touches = {} | |
local Frames = {} | |
local CurrentFrame = 0 | |
local Action = {} | |
local Actions, CurrentAction = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Accelometer Shake | |
supportedOrientations(LANDSCAPE_RIGHT) | |
function setup() | |
print("Shake a few times until the rect() exceeds the ellipse().") | |
end | |
local function deviceShaking() | |
local acceleration = UserAcceleration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local _line = line | |
local function lineCap(d) | |
for x = 1, d do | |
y = math.sqrt(d*d - x*x) | |
rect(0, 0, x, y) | |
end | |
end | |
function line(x1, y1, x2, y2, capMode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local _line = line | |
local function lineCap(d) | |
for x = 1, d do | |
y = math.sqrt(d*d - x*x) | |
rect(0, 0, x, y) | |
end | |
end | |
function line(x1, y1, x2, y2, capMode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--# Main | |
-- Procreate Animation Player [v1] | |
-- (c) kennstewayne.de | |
-- | |
-- Works only with Dropbox for now! | |
-- | |
displayMode(FULLSCREEN) | |
function setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--# Main | |
supportedOrientations(LANDSCAPE_ANY) | |
displayMode(OVERLAY) | |
function setup() | |
scene = craft.scene() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--# Main | |
-- mysql adapter | |
-- | |
-- TODO: write higher level API to mysql | |
-- app should cache inputs and push to mysql when server available | |
-- also queries should be wrapped in coroutines or something, to be async? | |
function setup() |
OlderNewer