0

I am making a kids drawing book app on cocos2d, I have completed my application for iPhone 4. I have made too many invisible boxes in my app for touch detection and all of them are set on fixed point co-ordinates for example

RectangleBox* pb1 = [RectangleBox alloc];
[pb1 setBoxProperty:CGRectMake(116, 193, 25, 25)];
RectangleBox* pb2 = [RectangleBox alloc];
[pb2 setBoxProperty:CGRectMake(129, 142, 25, 25)];

now I want all of them to move little bit on the right side of the screen and then I will replace the background image to cover the black portion of the screen

I want to know, what is the easiest way of doing it, I dont want to modify each and every box's position manually because there are too many boxes. but I will do that if there is no other way. Also please tell me how will i detect when the app is running on iphone 5 i am using cocos2d-iphone v2

sarfarazsajjad
  • 1,208
  • 2
  • 17
  • 30
  • For your first question, it's pretty subjective, and depends on your implementation, but it looks like you could do your adjustments for 4-inch iPhone in your setBoxProperty method. As far as detecting iPhone 5, is runningDevice not working for you? ( https://github.com/cocos2d/cocos2d-iphone/blob/develop-v2/cocos2d/CCConfiguration.m#L129 ) – Mark Sep 11 '13 at 21:39
  • I also tried to move scene by 50 points but after few seconds it moves back on left. do you have any idea what's the problem ? 'scene.position = CGPointMake(50, 0);' – sarfarazsajjad Sep 11 '13 at 21:51
  • "... but after few seconds it moves back on left ..." Sorry, can't help with that. All I can suggest is that you are probably doing something to reset the scene position somewhere else. Only you would know. – Mark Sep 11 '13 at 23:16

0 Answers0