Book Image

Cocos2d-x by Example: Beginner's Guide

By : Roger Engelbert
Book Image

Cocos2d-x by Example: Beginner's Guide

By: Roger Engelbert

Overview of this book

Table of Contents (19 chapters)
Cocos2d-x by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – laying down the rules


We'll update the RootViewController.mm file.

  1. Go to RootViewController.mm inside the ios folder and look for the shouldAutorotateToInterfaceOrientation method. Change the line inside the method to read:

    return UIInterfaceOrientationIsPortrait( interfaceOrientation );
  2. And a few lines below in the supportedInterfaceOrientations method, change the line inside the conditional to:

    return UIInterfaceOrientationMaskPortrait;

What just happened?

We just told RootViewController we want our application to play in any of the two supported portrait modes.