cocos2d for iPhone

A fast, easy to use, free, and community supported 2D game engine

Register or log in - lost password?
  • Blog
  • Store
  • Games
  • Documentation
  • Download
  • About

cocos2d for iPhone » Programming » cocos2d support (graphics engine)

disabling temporarily autorotation

(4 posts) (2 voices)
  • Started 1 year ago by MandarX
  • Latest reply from MandarX

Tags:

  • beginGeneratingDeviceOrientationNotifications
  • Box2D
  • disable autorotation
  • endGeneratingDeviceOrientationNotifications
  • shouldAutorotateToInterfaceOrientation
  • willRotateToInterfaceOrientation
  1. MandarX
    Member

    Hello,

    Is there a way to tell CCDirector to disable temporarily autorotation?

    I tried to comment some lines in shouldAutorotateToInterfaceOrientation and willRotateToInterfaceOrientation functions
    and I disabled it but Box2D doesn't work anymore!

    MandarX

    Posted 1 year ago #
  2. riq
    Key Master

    v1.x or v2.0 ?
    If v1.x, what kind of rotation did you enable in your GameConfig.h file ?

    Posted 1 year ago #
  3. MandarX
    Member

    I'm using v0.99.5

    in GameConfig.h GAME_AUTOROTATION is kGameAutorotationUIViewController

    should I set it to kGameAutorotationCCDirector ?

    MandarX

    Posted 1 year ago #
  4. MandarX
    Member

    found a solution

    [[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];

    and

    [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];

    hope it helps

    MandarX

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

cocos2d for iPhone is proudly powered by bbPress.