I'd just like to know if there are any good tutorials or advice or even code snippets on how best to handle on screen controls and multiple buttons presses / releases.

The way I've implemented it, is that I've abstracted out of the EAGLView the touch events and they are being passed down a chain to an object that is just concerned with making 'sense' of them.

I have the requirement for a joystick (say, D-Pad) on the left of the screen and three buttons on the right.

The three buttons can be pressed down at the same time as one or more of the D-Pad buttons, however, no more than one of the buttons on the right can be down at the same time.

Also, no more that 2 of the D-Pad buttons can be down at the same time, and as ofcourse, with a D-Pad I must expect the user to drag/move their finger from one part of the buttons to another and transition accurately between these 'states'

At the moment I've got the 'touchesBegan:touches blah blah' event passing the entire NSSet * of touches down to my delegate, so I can get the 'full' list of touch events.

But how do I seperate them out and make sense of it all?

My first attempt, was just to get the current position of the touch and make a basic ( if touch.x > button1.x and touch.x < button1.x + button1.width) blah
blah blah for all the buttons,

but I scrapped that because it can't handle all the 'semantics' of what I need.

When a new touch begins, do rough partitioning to determine whether it's in the d-pad area, the button area, or elsewhere (probably with a simple 2D squared distance test).

If in d-pad area:

If there's already d-pad touch being tracked, ignore it.

If not, partition the d-pad into 8 equal wedge-shaped regions and determine which one the touch is in, where the regions mean "left", "left-down", "down", etc. Compute this again each time this touch moves.

If in the button area:

Determine which button was pressed with some sort of partitioning that makes sense for your button layout. It's possible you'll want larger hit areas than the buttons themselves, but I'd have to play with it to know for sure.

Regardless of where this touch moves, the button is "down" while the touch is held, and "up" once it's released.