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

How to make a interactive menu?

Started by TNT_Nolan, 13 April 2016 - 04:22 PM
TNT_Nolan #1
Posted 13 April 2016 - 06:22 PM
I was wondering how to make a menu that you can click and you can choose options from it.
Dragon53535 #2
Posted 13 April 2016 - 06:43 PM
Like most things with programming, there's about a million different ways to go about a given problem. One could attempt to set up Lyqyd's Touchpoint API to do what you want, but that might not be the best. Another would be to make a similar API yourself as well that knows if a button is pressed. A third is that you could set up your own little map of the coordinates that each button is on and make sure that each is known where they are shown and can be pressed.

If you want to use/see how Lyqyd did it. Touchpoint.

My own setup with a grid of buttons that are numerically indexed. Here. It's not commented though, and not too good of a read. But you might see how I did it.
Will be working on comments.
Edit: My code only allows for clicks on monitors, however anything done for monitors is pretty much the exact same for the terminal if you wanted.
Edit2: Commented most of it. Working on the rest.
Edit2: Commented all of it. I did a lot of funky math for figuring which button to toggle. Just because I could.
Edited on 13 April 2016 - 05:38 PM
TNT_Nolan #3
Posted 13 April 2016 - 08:53 PM
Im trying to use that Touchpoint API but it just doesn't work. Any other suggestions?
Dragon53535 #4
Posted 13 April 2016 - 10:12 PM
How are you using it? It could be a problem with your implementation. Show your code please.