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 7575617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:43:31+00:00 2026-05-30T16:43:31+00:00

I am dealing with a Cocos2D iPhone app with the Game Center Leaderboard. In

  • 0

I am dealing with a Cocos2D iPhone app with the Game Center Leaderboard. In this app the user has to draw lines in a landscape mode (the iPhone is horizontal). It happens then that the touch may begin outside the screen (in the left side near the microphone) and continue inside the screen. The app correctly starts drawing things as soon as the finger enters in the screen framework. However if I show the view with the leaderboard (that is actually correctly depicted) and I come back to the game the app stops handling touches that begin outside of the screen. It actually stops handling only those starting on the top of the screen as if there is a line of pixel at the top that are not considered.

I started the leaders board this way:

- (void) showLeaderboard
{
   GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init];
if (leaderboardController != nil){
    tempVC=[[UIViewController alloc] init] ;
    leaderboardController.leaderboardDelegate = self;
    [[[CCDirector sharedDirector] openGLView] addSubview:tempVC.view];

    [tempVC presentModalViewController:leaderboardController animated:YES];
    tempVC.view.transform = CGAffineTransformMakeRotation(CC_DEGREES_TO_RADIANS(0.0f));
    tempVC.view.bounds = CGRectMake(0, 0, 480, 320);
    tempVC.view.center = CGPointMake(240, 160);

    [leaderboardController release];
}
}

and release it this way:

-(void) leaderboardViewControllerDidFinish: (GKLeaderboardViewController *) viewController{
[tempVC dismissModalViewControllerAnimated:YES];
[tempVC.view.superview removeFromSuperview];
[tempVC.view removeFromSuperview];

[tempVC release];


}
  • 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-30T16:43:32+00:00Added an answer on May 30, 2026 at 4:43 pm

    Well, your problem sounds a bit nasty, and all I can provide is a guess to where the problem might be..

    I have a Cocos2d Game with Leaderboards integrated, and the touches are working perfectly, so let me give you the details on how I add the leaderboard viewController, and you might want to try it out:

    Note:It is generally better to use UIKit elements in cocos2d using the RootViewController, added in v0.99.5.

    //Action method invoked upon pressing the "Show LeaderBoards button"
    -(void)showLeaderboardButtonClicked {
        [gameCenterHandler showLeaderboard];
    }
    
    //Inside the GameCenter Handler:
    -(void) showLeaderboard {
        if (isGameCenterAvailable == NO) {
            return;
        } else if (![[GKLocalPlayer localPlayer] isAuthenticated]) {
            [self authenticateLocalPlayer];
        } else {
            GKLeaderboardViewController* leaderboardVC = [[[GKLeaderboardViewController alloc] init] autorelease];
            if (leaderboardVC != nil) {
                leaderboardVC.leaderboardDelegate = self;
                [rootVC presentModalViewController:leaderboardVC animated:YES];
            }
    }
    
    -(void) leaderboardViewControllerDidFinish:(GKLeaderboardViewController*)viewController {
        [rootVC dismissModalViewControllerAnimated:YES];
    }
    

    Where rootVC is in AppDelegate.h:

        RootViewController  *viewController;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Cocos2d/openGL iPhone game. It's a universal app and I'm dealing with
I am dealing with very primitive HTML construction that goes like this: <a NAME=header1></a><b><font
I'm dealing with this situation : I have a color animation script which targets
When dealing with strings (it has its own state like comments) i need to
I'm dealing with this tutorial: http://www.lucazanini.eu/2012/android/tabs-and-swipe-views/?lang=en . The problem is that if I set
I am brand new to Cocos2d and have begun making a simple card game.
When dealing with multiple classes in a Javascript/NodeJS game, I'm having trouble figuring out
Dealing with an animation of large images, you can do this: Simply alloc memory
When dealing with this array, notices are given each time the array is referenced
I'm dealing with a pretty simple template struct that has an enum value set

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.