Hello all,
I swear I did all the researches in the forum but I wasn't able to find any suitable solution using the latest Sparrow framework (2.0.1) and latest XCode (5.1).
Basically, I'd like to have a single scene in my application (which is not really a game, but still it's based on the Sparrow framework) with both the landscape and the portrait orientations supported.
What I did for now is that I created a custom class, which inherits from SPViewController and I've overriden the basic iOS functions (
- (NSUInteger)supportedInterfaceOrientations;
- (BOOL)shouldAutorotate;
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
), I've double checked in the project informations that the two orientations I'd wish to support are ticked (Portrait and Landscape-left) but I noticed that both the versions of the will(Animate)RotateToInterfaceOrientation
are never called.
Just to give a little background: we're currently working on a lasergame-like game with physical robots (drones and Lego's NXT-based robots), and for the first prototype we have a small tank for which we'd like to have two different views: the portrait view which shows the camera attached to the robot in the upper part of the screen, and the map of the actual game in the bottom part, the player who's driving the tank will use this view and he won't be able to use the lasers of the tank ; this is working already and thanks to Sparrow, the GUI development was really easy, funny and straightforward.
What we would like to achieve now is that when the player rotates his phone, a message is sent to the game server and he will be able to use the cannons (hence, he will stop driving the tank) and we would like also to change the interface, as the shooter needs to have a better visibility and doesn't want to be bothered with all the game-related things (I JUST WANT TO KILL!); hence, I really need to "catch" the rotation, send the message to the server and - if the server allows the switch from driver to shooter - drastically modify the interface.
The problem is that I'm really blocked in catching the notification, would you have any suggestion?
Best regards,
Massimo - (Orwell Developer)