Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a game layer that should be pannable and pinchable and a GUI layer as an overlay that's excluded from the transformations. I added the pinch and pan gesture recognizer to the view and set the view.transform like so

view.transform= CGAffineTransformConcat(panTransformation, pinchTranslation);

But it actually scales/moves the GUI layer, ofcourse, as it is a layer added to that view aswell. Sure I could do the transformations the layer itself, but the touch coordinates are scaled aswell, and calculating where the user actually tapped based on scale and translation looks like a big overhead to me.

Can I somehow add a separate view and make a GUI layer it's child? Or in any other way add GUI layer that's excluded from the transformations ?

share|improve this question
I'm not sure if I understood the question right, but I guess you can manage the GUI yourself, instead of adding it as a child. And override function visit to do GUI visit separately. – Ali.S Feb 26 '13 at 19:32
I'm not sure what you mean manage GUI myself. Can you elaborate, please ? – user1304844 Feb 26 '13 at 21:47
by managing I meant retaining, and later releasing, and visiting it yourself. instead of relying on addchlid/removeChild method of CCNode. – Ali.S Feb 27 '13 at 4:55
I understand. The problem is whatever I'd draw, it'd still be translated since the view has been pinched and panned? – user1304844 Feb 28 '13 at 8:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.