by twobob » Fri Feb 17, 2006 2:47 pm
A bit long winded but this is one way
Create a variable to control your box position. - (int buttoncontrol)
Have one actor to control all key down events. (menucontroller) –also could use say background actor.
On Create (menucontroller) - script editor – initialize your variables
example :
buttoncontrol = 1;
box.x = 52; //where your first button is
box.y =100;
Add key down event for menucontroller, for say the ‘down’ key, add something like the following script
buttoncontrol = buttoncontrol + 1;
if(buttoncontrol == 3){buttoncontrol = 1;}
switch(buttoncontrol)
{
case 1:
box.x = 52; //if buttoncontrol == 1 then place box round button 1
box.y = 100;
return;
case 2:
box.x = 52; //if buttoncontrol == 2 then place box round button 2
box.y = 50;
return;
}
Add another key down event for menucontroller for the up key (to go up the menu)similar to above but altering:-
buttoncontrol = buttoncontrol - 1;
if(buttoncontrol == 0){buttoncontrol = 2;}
Add another key down event for menucontroller, say key ‘m’ for menu so that the user can choose the selected button that is marked with the box, and add similar to below
switch(buttoncontrol)
{
case 1:
//PUT YOUR CODE HERE FOR BUTTON 1 ACTION
break;
case 2:
//PUT YOUR CODE HERE FOR BUTTON 2 ACTION
}
Alter the case statements to suit your button actions – probably similar to your mouse down actions for the buttons