Skip to content

Instantly share code, notes, and snippets.

@devilstower
devilstower / Main
Created January 8, 2012 19:54
Orb-Bits
-- Orb-Bits
-- =======================
-- Version 1.0
-- 8 Jan 2012
-- Mark Sumner
-- devilstower@gmail.com
-- =======================
function setup()
    displayMode(FULLSCREEN)
@devilstower
devilstower / Chooser
Created January 11, 2012 01:11
Spritely II 0.95 (part 1)
-- ====================
-- Chooser 
-- ver. 0.1
-- a control for choosing between two options
-- ====================
-- This control depends on a global instance of
-- the class Font10x12 called afont.  That instance
-- should be created in the Main setup() function
-- before any instance of this class is created.
@devilstower
devilstower / SImage
Created January 11, 2012 01:17
Spritely II 0.95 (Part 2)
SImage = class()
function SImage:init(name, img)
    self.frame = Frame(0,0,0,0)
    self.name = name
    self.img = img
    self.sel = false
end
function SImage:draw()
@devilstower
devilstower / ColorTray
Created January 16, 2012 20:22
Spritely beta
-- ColorTray 
-- ver. 0.1
-- a control for displaying an array of colors
-- ====================
ColorTray = class()
function ColorTray:init(x1, y1, x2, y2, clr)
    local x, y, w, h, i
    self.frame = Frame(x1, y1, x2, y2)
@devilstower
devilstower / Slider
Created January 16, 2012 20:30
Spritely Beta 2
-- Slider 
-- ver. 0.1
-- a control that replicates the iparameter slider
-- ====================
-- This control depends on a global instance of
-- the class Font10x12 called afont.  That instance
-- should be created in the Main setup() function
-- before any instance of this class is created.
Slider = class()
@devilstower
devilstower / DataSeries
Created January 27, 2012 05:08
TrendGrahics 1.3
DataSeries = class()
function DataSeries:init(name, length, min, max, symbol, symbolsize, thick, clr)
    self.name = name
    self.symbol = symbol
    self.symbolsize = symbolsize
    self.nextpt = 0
    self.length = length
    self.lineclr = clr
    self.linethick = thick
@devilstower
devilstower / Arena
Created April 23, 2012 02:43
Battle Chips 0.1 (part 1)
Arena = class()
function Arena:init(l, b, r, t)
    -- you can accept and set parameters here
    self.frame = Frame(l, b, r, t)
    self.panel = Frame(l + 1, b + 1, r - 1, b + 108)
    self.stop = Frame(r - 100, b + 35, r - 60, b + 75)
    self.robots = {}
end
@devilstower
devilstower / Token
Created April 23, 2012 02:46
Battle Chips 0.1 (part 2)
Token = class()
function Token:init(code, x, y, clr)
    -- you can accept and set parameters here
    self.x = x
    self.y = y
    self.code = code
end
function Token:draw()  
@devilstower
devilstower / Arena
Created April 24, 2012 22:13
Battle Chips 0.20
Arena = class()
function Arena:init(l, b, r, t)
    -- you can accept and set parameters here
    self.frame = Frame(l, b, r, t)
    self.panel = Frame(l + 1, b + 1, r - 1, b + 108)
    self.stop = Frame(r - 100, b + 35, r - 60, b + 75)
    self.robots = {}
end
@devilstower
devilstower / TextBox
Created April 24, 2012 22:18
Battle Chips 0.20 (part 2)
TextBox = class()
-- TextBox 
-- ver. 1.0
-- a control for basic string editing
-- ====================
function TextBox:init(x, y, w, s)
    self.x = x
    self.y = y