No, it's not incredible. No, it's not almighty.
However, it is quite nifty, and I like it.
Now, anyways. This thing has a terrible name, yes?
Well, it stands for "Light-Weight ComputerCraft Graphics Library". Yes, I got the inspiration from LWJGL. No, you may not judge me.
I know that it's not impressive, but it works.
Example (with the API saved as 'lwccgl'):
os.loadAPI('lwccgl')
local circle = lwccgl.add_circle(8, 8, 7, colors.blue)
circle:draw()
local button = lwccgl.add_button(4, 4, 5, 2, colors.yellow, "Test")
button:draw()
button:input()
print("You pressed the button!")
Now for documentation.
THIS IS AN OBJECT-ORIENTED API.
Base API functions:
-- Creates a button object and returns it.
-- The color and text parameters can be left out.
button = lwccgl.add_button(x, y, width, height, color, text)
-- Creates a circle object and returns it.
-- The color parameter can be left out.
circle = lwccgl.add_circle(centerX, centerY, radius, color)
Button object:
-- Renders the button.
draw()
-- Waits for the button to be clicked.
input()
Circle object:
-- Renders the circle.
draw()
By the way, I do have a small license:
You may use this API however the hell you want.
I'd like it if you told me about your use of it, though. :D/>
Pastebin:
http://pastebin.com/4C3L6QFi
Get the API:
pastebin get 4C3L6QFi lwccgl
Changelog:
Spoiler
1.0.1: Circles added1.0.0: Buttons added
Don't expect this to be all.
Also:
PLEASE, FOR THE LOVE OF ALL DIVINE THINGS, REPORT YOUR BUGS!