Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("/bufferAPI")
- local x1, y1 = 1, 1
- local x2, y2 = term.getSize()
- local buffer = bufferAPI.newBuffer(x1, y1, x2, y2)
- --[[
- All handle functions:
- buffer:setBufferSize(x1, y1, x2, y2)
- buffer:clear(color)
- buffer:setPixel(x, y, c1, c2, char)
- buffer:write(x, y, c1, c2, string)
- buffer:loadImage(x, y, image, useBlittle)
- buffer:loadBox(x1, y1, x2, y2, c1, c2, char)
- buffer:loadBorderBox(x1, y1, x2, y2, c1, c2, char)
- buffer:loadBorderBoxBlittle(x1, y1, x2, y2, c1, c2, char)
- buffer:loadLine(x1, y1, x2, y2, c)
- buffer:loadTriangle(x1, y1, x2, y2, x3, y3, c)
- buffer:loadCircle(x, y, c1, c2, char, radius)
- buffer:drawBuffer(blittleOn) -- For drawing the buffer
- ]]--
- function drawScreen()
- -- Load everything into the buffer
- buffer:clear(colors.lime)
- buffer:write(5, 5, colors.blue, colors.white, "This is text.")
- buffer:loadTriangle(8, 6, 4, 15, 20, 12, colors.red)
- -- Draw the buffer
- buffer:drawBuffer(false) -- BlittleOn
- end
- while true do
- drawScreen()
- -- Do stuff here
- os.queueEvent("FakeEvent")
- os.pullEvent("FakeEvent")
- end
Add Comment
Please, Sign In to add comment