Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("apis/qmain")
- os.loadAPI("apis/qformat")
- os.loadAPI("apis/qbutton")
- function screen()
- qbutton.drawButton("one")
- qbutton.drawButton("two")
- end
- function writeText(text)
- monitor.setCursorPos(4,7); monitor.write(text)
- end
- --init
- monitor = qmain.setDefaultScreen("top")
- monitor.setTextScale(2)
- qmain.clear()
- --test
- qbutton.setButton("one", "Click Me!", qbutton.changeButton, {"one", "color", {"d", "f"}}, {2,3}, {11, 3}, {"a", "l"})
- qbutton.setButton("two", " ", writeText, {"xd"}, {2, 7}, {1, 1}, {"d", "a"})
- screen()
- while true do
- event, side, x, y = os.pullEvent("monitor_touch")
- if qbutton.clickOn({x, y}) then
- screen()
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement