Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.find("monitor")
- width, height = monitor.getSize()
- title = "Ore Processing"
- buttons = {}
- function createButton(name, func, x, y, w, h)
- nameLen = string.len(name)
- buttons[name] = { name, func, x, y, w, h, nameLen }
- monitor.setBackgroundColor(colors.red)
- for i = y, y + h do
- monitor.setCursorPos(x, i)
- for j = 1, w do
- monitor.write(" ")
- end
- end
- monitor.setCursorPos((x + x + w) / 2 - nameLen / 2, (y + y + h) / 2)
- monitor.write(name)
- --monitor.setCursorPos(5, 3)
- --monitor.write()
- end
- function draw()
- monitor.setBackgroundColor(colors.black)
- monitor.clear()
- monitor.setCursorPos(width / 2 - 7, 1)
- monitor.write(title)
- createButton("Test Button", test1, 5, 3, 13, 3)
- end
- while true do
- draw()
- os.sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement