I'm doing some menu stuff in my game. I want the GamePad (d-pad) to be able to go up/down, left/right in a grid. It needs to highlight the one it's on and then do an action when user hits the "A" button.
I'd like to hear some suggestions on how people have done this. I need to be able to pick the object (all objects are the same type) and reference it directly once "on it". So when the gamepad hits "A" it knows which object it's on and uses that objects instance variables to do certain things.
Here's a capx test of what I mean... I've done it with the Mouse which is much simpler since the user selects the "button" they want, opposed to having to scroll through it. But I need to use the GamePad.
In my real game I've started to make it work in a cludgy way by making an array of all the XY positions of the buttons then depending on where I am in the array I know which button I'm on, but I obvious can't access that button's instance variables!
In this test I figured a way to scroll through with cycling the IIDs however this does not help me going Left or Right with the d-pad.. so maybe there's a completely different way to do it?
any help would be greatly appreciated!