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

[drawbox][menu] help needed please?

Started by Goof, 27 October 2012 - 06:39 AM
Goof #1
Posted 27 October 2012 - 08:39 AM
Hey

i have made a couple of programs before, but now i've trying something new… i wanted to make a "Menu" with two "menu"
boxes like this :



¤ = Air
# = a letter / a '#'

######¤¤¤######
#¤¤¤¤#¤¤¤#¤¤¤¤#
#¤¤¤¤#¤¤¤#¤¤¤¤#
#¤¤¤¤#¤¤¤#¤¤¤¤#
#¤¤¤¤#¤¤¤#¤¤¤¤#
######¤¤¤######


and then i did want to make a menu out of thoose two boxes like this:

the o's is so i know which "box" are selected…



######¤¤¤######
#oooo#¤¤¤#¤¤¤¤#
#o o#¤¤¤#¤¤¤¤#
#o o#¤¤¤#¤¤¤¤#
#oooo#¤¤¤#¤¤¤¤#
######¤¤¤######







i'm kinda newb in Mouse_Clicks, or menu making on this method (with the boxes)

but i can show you a bit of my code ( does not include the menu… i just want explanation about how i can make a menu out of boxes)




Spoiler

function LogWelcomeOS()
drawBox(18,8,22,12)  -- this is an function above --
drawBox(26,8,30,12)  -- this too --
Pos2(15,6) -- term.setCursorPos() function--
print("Guest V")
Pos2(24,6)
print("Admin V")
								--here i have my box "Menu"--
SE(5) -- sleeps ('amount') of seconds --
while running do -- here i am trying to make the menu methods... but without luck --
end
end



edit: i cant make the size bigger… i've tried with but nothing happens


darkrising #2
Posted 27 October 2012 - 01:16 PM
Hmm do you mean like on this post:
http://www.computercraft.info/forums2/index.php?/topic/5453-need-explanation-for-mouseclicks/
Goof #3
Posted 27 October 2012 - 02:24 PM
yeah! but just with boxes, and then if i click into a box it will read the box, currently clicked on. and then continue
ChunLing #4
Posted 27 October 2012 - 04:04 PM
You can use the lua program to test the function to print out your boxes, and then call that function followed by
repeat t_event = {os.pullEvent()} term.setCursorPosition(1,1) write(textutils.serialize(t_event)) until t_event[2] == "X"
Change that (1,1) to someplace where you can get the output without messing up places you want to click.

This is just so that you can see what the event will look like from clicking various places, it's not for your final program.
Edited on 27 October 2012 - 02:05 PM
Goof #5
Posted 27 October 2012 - 04:23 PM
Okay! thank you guys so much!