Posted 10 January 2013 - 12:00 PM
Hey guys,
here is a small window api I wrote for myself.
It is definitely missing some functionality which will follow.
I will update it as im working on it for myself. :rolleyes:/>/>
Code: http://pastebin.com/mLqWVEUf
Screenshot:
Functions:
Example (From Screenshot):
Changelog:
here is a small window api I wrote for myself.
It is definitely missing some functionality which will follow.
I will update it as im working on it for myself. :rolleyes:/>/>
Code: http://pastebin.com/mLqWVEUf
Screenshot:
Spoiler
Functions:
Spoiler
window.new(x, y, width, length)
windowA:getTitle()
windowA:setTitle(title)
windowA:setLine(line, text, color) (line is relative to the window. 1 always first line, 2 second line...) (color is optional)
windowA:getLine(line)
windowA:clearLine(line)
windowA:setBackgroundColor(color)
windowA:setBorderColor(color)
windowA:setTitleColor(color)
windowA:draw()
Example (From Screenshot):
Spoiler
os.loadAPI("apis/window")
term.clear()
reactor = window.new(1,1,22,9)
reactor:setTitle("Nuklear Reaktor")
reactor:setBorderColor(colors.red)
reactor:setTitleColor(colors.green)
reactor:setLine(1, "Status: Online")
reactor:setLine(2, "Hitze: 100")
reactor:setLine(3, "Max.: 10000")
reactor:setLine(4, "Zeit: 2h 59m 59s")
reactor:setLine(5, "Output: 280 EU/t")
reactor:draw()
mfsu1 = window.new(24,1,21,6)
mfsu1:setTitle("MFSU Base")
mfsu1:setBorderColor(colors.green)
mfsu1:setTitleColor(colors.red)
mfsu1:setLine(1, "Energie: 10000000")
mfsu1:setLine(2, "Max.: 10000000")
mfsu1:draw()
mfsu2 = window.new(24,8,21,4)
mfsu2:setLine(1, "Energie: 10000000")
mfsu2:setLine(2, "Max.: 10000000")
mfsu2:draw()
os.pullEvent("key")
term.clear()
term.setCursorPos(1,1)
Spoiler
10.01.2013Windows now draw backgrounds (Color changeable) - allows overlaying windows.
Line colors! - windowA:setLine(line, text, color)