Hi
I've been reading three books (iPhone Game Development, iPhone cookbook and beginning iPhone development), but so far I've not found the answer to my question, so I was hoping someone here could help me.
As an example, lets say that I want to have a joystick onscreen, and three buttons.
I need all of these permanently visible on the bottom of the screen and not taking up any of the game rendering area i.e. not overlayed onto the game.
Ok?
Now, from what I can gather, one way to do this, if I've understood this correctly, is to break those FOUR controls, and put each one on it's OWN VIEW (OR SUB-VIEW), and have transparency where the other controls are on each layer...
So layer 1, will have the joystick and the background around the joystick, but a transparent section to the right of it...
the layer underneath that will be transparent where the (above layer) joystick is, and then have the bitmap for the button, and then transparent again to the right of that button... etc etc for each further layer / button.
That way I have a hierarchy for touch testing, if it's on a transparent area, send to the next sub-view.
However, by the time I've got the game rendering and the scores etc... I'm looking at about 7 views...
So my questions are these:
Is this the best (optimal) way to do this? If not, then how?
Is there a performance or SDK limit on View's with subviews or just multiple layers of views?
Can all this be done on one layer / view =- bearing in mind that the joytick will move in all directions at the SAME TIME as one or MORE of the buttons can be pressed. therefore a false 'pinch' gesture could be detected by a button on the right of the screen being pressed at the same time the joystick is moved away from that finger press... see?
Please help, if you can.
If I've over complicated this, or got confused, please forgive me - I find it VERY difficult to 'teach' myself stuff... and if my explanations are confusing, please let me know and I'll try and rewrite them.
Thanks