Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local unicode = require("unicode")
- function drawButton(x,y,bg,fg,text)
- local oldbg = gpu.getBackground()
- local oldfg = gpu.getForeground()
- gpu.setBackground(bg)
- gpu.setForeground(fg)
- gpu.set(x,y,text)
- gpu.setBackground(oldbg)
- gpu.setForeground(oldfg)
- end
- drawButton(2,2,0xff0000, 0x00ff00, "PressMeToWin")
- while true do
- local name, add, xP, yP, b = event.pull("touch")
- if name ~= nil then
- if xP >= 2 and yP == 2 and xP <= 2 + unicode.len("PressMeToWin") then
- gpu.set(1,20, "Ok!")
- os.sleep(2)
- gpu.fill(1,20,10,10, " ")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement