Calling Game Center from Cocos2D-X V2

So calling Game Center, or more precisely rather adding its sub-view to your games EagleView has changed a little.

If you do it the old way the Game Center view will be half off the screen depending on the rotation of the device.

[codebox 1]

Changing the code to the following fixes this.

[codebox 2]

Below is the complete code for calling Game Center to display achievements and the leaderboard. Note that from iOS6 the Game Center view has tabs at the top so the user can get to achievements/leaderboards; However, if they are running on an iOS5 or below device (like an iPhone 3GS) then you still need separate buttons for the user to get to achievements and leaderboards.

[codebox 3]