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

Simple Menu Tool

Started by Jyzarc, 22 January 2014 - 06:02 PM
Jyzarc #1
Posted 22 January 2014 - 07:02 PM
I needed a simple menu for a program I was making, so i decided to just make a sort of simple menu tool that anyone could use in their program. It could also maybe help others who are new to coding learn about menu making. I am not sure I recommend this because I am not a great programmer. Basically each item on the menu has a single function it runs when it is activated, the item also has a specific color and text. The menu will center text correctly on any monitor size.

How to use:
Basically all you have to do is fill the menu.items table with a few objects
Text, just what it says on the screen
Handler, the name of the function it will run, make sure you write it without the ()
Color, the color of the text
Bounds = {}, just leave that empty but make sure it exists.
If this isn't very clear(it isnt) you can just base it off of my examples in the code.

download:
http://pastebin.com/biivLwcJ
RoD #2
Posted 30 March 2014 - 10:05 AM
At first, a bug, when i press up, down, right or left:

menu:190: attempt to index ? (a number value)
I then tried to click and it worked (i think).
Plus, try to reduce the code size, use functions, etc..
Good luck ;)/>