This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Zambonie's profile picture

Q:How to make things clickable?

Started by Zambonie, 24 December 2012 - 05:59 AM
Zambonie #1
Posted 24 December 2012 - 06:59 AM
Because 1.48 just came out with touchscreen monitors,Im gonna make my own program thats compadible with that.But first I need a peice of code to make it clickable to do it.Do any of you guys have an peice of code that can proboly do that?Thank you if you do.
NDFJay #2
Posted 24 December 2012 - 07:02 AM

local event = os.pullEvent()
if event == "mouse_click" then
   if X >= 1 and X <= 5 and Y >= 1 and Y <= 5 then
	 --do something
   end
end

that will make a 5x5 click-able square in the top right corner of your screen
Doyle3694 #3
Posted 24 December 2012 - 07:04 AM
top left actually ;)/>
Zambonie #4
Posted 24 December 2012 - 07:12 AM
Ok,thanks.