Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6753337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:08:58+00:00 2026-05-26T13:08:58+00:00

I am writing a game for the iPhone/iPodTouch (using Cocos2d) and I have noticed

  • 0

I am writing a game for the iPhone/iPodTouch (using Cocos2d) and I have noticed something strange…

I need to detect the parts of the screen which the player touches in order to perform certain actions.

For example:

-(void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event {
CGPoint touchLocation = [touch locationInView:[touch view]];    
//DEBUG
CCLOG(@"Button pressed: X Location: %f",touchLocation.x);
CCLOG(@"Button pressed: Y Location: %f",touchLocation.y);

…
And when touchLocation.x and touchLocation.y are both within a certain range, I do something.

It worked on the simulator fine. When I compiled it for my test device, using armv7 architecture (optimized) it also worked. But when I compiled it with armv6, armv7 architectures enabled (which is what the app store requires), I noticed that the code no longer worked. The CCLOGs showed me that the X,Y coordinate system used when I compiled for armv6,armv7 was DIFFERENT to that used when I only compiled for armv7 (optimized).

How can I get around this problem? Is the only way to use the coordinate system used by armv6,armv7 when testing on the device… (this doesn’t work on the simulator)? There is no way I can upload an app for the iPhone and compile only for armv7 (optimized). 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:08:58+00:00Added an answer on May 26, 2026 at 1:08 pm

    For finding touches on screen in cocos2d, Try this code. Its working correctly in my game app

    - (void)ccTouchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
        UITouch *myTouch = [touches anyObject];
        CGPoint location = [myTouch locationInView:[myTouch view]];
        location = [[CCDirector sharedDirector] convertToGL:location];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an iphone game using cocos2d and box2d engines. I have a
I'm writing a game using cocos2d-iphone and our stages are defined in .plist files.
I'm writing a game for iPhone, and I want an online leaderboard using mySQL,
I'm writing an iPhone game in objective-C using XCode. I'd like to profile the
I'm writing a retro type game for the iPhone, and need to render a
I'm writing a game which is taking user input and rendering it on-screen. The
I'm writing a game which uses a border layout with a JPanel using BorderLayout.CENTER.
I am writing a game in Java, and need to have mouse interaction. I
I have a children's iPhone application that I am writing and I need to
I am writing an iPhone game and have it working well with my level

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.