Posted 08 August 2015 - 04:44 PM
GraphAPI by tattyseal
What is it?
GraphAPI provides an easy way to render progress bars and graphs.
How do I use it?
This code example shows everything that can be done at present and what it does:
--This will load the API
os.loadAPI("graphAPI") --Change graphAPI to what you have save it as
--This adds a graph. name, x, y, width, height, color, value, maxValue
graphAPI.addGraph("graph", 1, 1, 20, 3, colors.red, 0, 100)
--This function updates the value
graphAPI.updateValue("graph", 20)
]--This function updates the maximum value
graphAPI.updateMaxValue("graph", 200)
--This function will set if the graph is drawn horizontally. Default: false
graphAPI.setHorizontal("graph", true)
--This function will set if the graph draws its progress 0% - 100%. Default: true
graphAPI.setShowText("graph", true)
--This function will set if the the graph draws its outline. Default: true
graphAPI.setShowOutline("graph", true)
--This function will set the color of the graph.
graphAPI.updateColor("graph", colors.lime)
--This will set what monitor to draw on. NOTE: This will redirect to the monitor specified before drawing
graphAPI.setMonitor(peripheral.wrap("top"))
--This is required to draw all graphs.
graphAPI.draw()
How do I get it?
Pastebin: http://pastebin.com/k3Bs0yhQ
Screenshot
Edited on 08 August 2015 - 02:45 PM