
-----------------------------------
uberwalla
Sun Nov 19, 2006 9:00 pm

Problems with Menu
-----------------------------------
ok, so i'm making a game (not being disclosed at the time which it might be), and im trying to make a menu for it. ive made the buttons// wrote the code but i can't get it so that when u select a button that it goes over it with the different color button to show it is being looked over (not yet clicked though). all is included in the attachment im adding, any help would be great. :D

- i'm mainly looking for how to have it so that the green buttons (when pressed) dont flash so that u can't see them. thx in advance.

-----------------------------------
Clayton
Sun Nov 19, 2006 9:26 pm


-----------------------------------
just have a simple check to see if the mouse is over the button (but not pressing) then have the button drawn in a different color.

really, this kind of problem isnt that hard to figure out, it almost feels like no one is putting any effort into thinking about the problems that they come up to when it's time to solve them. :?

-----------------------------------
uberwalla
Sun Nov 19, 2006 9:46 pm


-----------------------------------
well im not actually using the mouse in this, i think i forgot to say that :S 

im using arrow up/down. but i think ill try the mouse idea, yet i have never used it b4  lol 

thx.

-----------------------------------
neufelni
Sun Nov 19, 2006 10:12 pm


-----------------------------------
What you could do is make a variable for your position in the menu. So if you have 4 menu options you would use something like this:
var position : int := 1

if upArrow and position not= 1 then
    position += 1
if downArrow and position not= 4 then
    position -= 1
if position = 1 then
    draw button 1 different color
if position = 2 then
    draw button 2 different color

etc...


-----------------------------------
uberwalla
Sun Nov 19, 2006 10:25 pm


-----------------------------------
ok i dont quite understand that nick... lol

where do the blue and green buttons come into play. im not saying for u to write my whole code over or w.e obviously but... im asking if i still start with blue buttons then where u have (draw button 1 different color ) thats where green goes? and \where should i put the end if? at end of it all and add elsifs?

-----------------------------------
ericfourfour
Mon Nov 20, 2006 12:10 am


-----------------------------------
If you know records just make a list of buttons and have one member of the record be the colour. Then have a variable that keeps track of the selected button. If the button is selected change the colour.

-----------------------------------
uberwalla
Mon Nov 20, 2006 12:24 am


-----------------------------------
ok, thx i think i get what ya mean with the records.

and i was wondering if i could also get help with mouse part with the menu. i think it would be more effciant.

if possible i would like to know if u can have the button change color by just going over it in turing and not clicking right away. and if it is possible if someone could guide me in the right direction :D

-----------------------------------
Clayton
Mon Nov 20, 2006 10:36 am


-----------------------------------
ugh... I already told you it was possible to do this, just read my first post and you will be fine, think for yourself, it's not even hard, use pencil/pen and paper, plan it out, think. These skills are extremely important for someone to be a good programmer, because you have to be able to problem solve.

-----------------------------------
uberwalla
Mon Nov 20, 2006 3:55 pm


-----------------------------------
ok well, im sorry for acting needy and such, but i have indeed done the research. and i do understand the basic concept of mousewhere and stuff but i was wondering if there is an easy way of doing it. as in:

if mousewhere = picsoandso then
pic.draw (etc.)
end if

is that possible in a sence? i tried it and it didnt work. but is there a way to call upoon the picture so it gives the coordinates instead of saying

if x >= blah then
...
if x = blah then
...
if x 