Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
06-08-2012 06:01 AM
I am developer games for both PlayBook and BB10. Some games are portrait, others are landscape, none of them support multiple orientations. In terms of making OpenGL render at the correct orientation, and making sure my touch screen input is correct I have had no problems, I am used to having to deal with various hardware orientations from working on multiple different platforms. What I am struggling with is how to ensure the system dialogs are always displayed at the correct orientation.
Lets take for example a portrait game, running on the PlayBook, in my bar descriptor XML, I have:
Then in my code I have:
navigator_rotation_lock( true );
As I say, GL/input is handled by our engine so this all comes through correctly. If I launch the application from the PlayBook, with the PlayBook already in portrait, it works correctly, system dialogs appear at the same orientation as the game. However, if I launch the game from landscape, the game all functions correctly however system dialogs appear in landscape (despite the game being in portrait). So to try and compat that I started messing around with the following functions (before locking rotation):
navigator_set_orientation( 90, NULL );
navigator_set_window_angle( 90 );
I have been plugging different rotation values in (90, -90, 270, etc.) and seem to sometimes get builds that orient correctly from one launch angle, but fail in other launch angles. After some messing around I got it working from all launch angles (hurrah!) thank goodness for that I thought. But then I relaunched the application and it once again displayed system dialogs at the wrong orientation. After some messing around, I found that if, whilst on the desktop/OS, I rotate the device left, to portrait, and then back to landscape, then launch the game, sometimes I would get different dialog orientation to if I rotate the device right to portrait, then back to landscape, then launch the game.
On top of this, I find sometimes the build is all looking okay, then I'll flick the application to 'card view', rotate the device around a bit whilst in card view, then go back to my application, and the system dialogs then are incorrect.
Can anyone help?! What I want to do is actually incredibly simple, I want to just lock my game to either portrait, or landscape. Once locked I never want it to change. Plus I want all system dialogs to also obey the orientation I am using.
Hopefully I am over thoroughly over-complicating this and there is a simple solution?!
Paw Print Games Ltd.
06-08-2012 01:19 PM
dialog_create_prompt( &m_ActiveDialog );
dialog_set_size( m_ActiveDialog, DIALOG_SIZE_SMALL );
dialog_set_title_text( m_ActiveDialog, "Enter your Scoreloop name" );
dialog_set_prompt_message_text( m_ActiveDialog, "Please choose Scoreloop name");
dialog_set_prompt_input_field( m_ActiveDialog, m_UserLogin );
dialog_add_button( m_ActiveDialog, DIALOG_OK_LABEL, true, NULL, true );
dialog_set_default_button_index( m_ActiveDialog, 0 );
dialog_show( m_ActiveDialog );
06-08-2012 01:21 PM
I should probably also note, it isn't the dialog system which is at fault, the 'card view' gesture (swipe up) also get confused when the orientation goes wrong, as in if the dialog is displaying messages at the wrong orientation, the swipe up gesture will also be wrong (however the swipe up gesture will be the same orientation as the dialog box). Essentially the system believes my game/window/something is at a different orientation to what it actually is.
06-08-2012 02:24 PM
The code you are using seems correct. Given that you are able to observe this with the gestures as well strongly suggests a bug.
I would recommend logging an issue in the Issue Tracker by following the link below:
06-12-2012 10:56 AM
This topic is know to be confusing at first. Have you looked at the GoodCitizen and HelloWorldDisplay samples?
It seems that you want to achieve an effect similar to what GoodCitizen does - on a swipe down a menu animation is triggered. In case of locking orientation - it is the same c++ code as in GoodCitizen, but bar-descriptor settings are different.
Take a look at the sample code, and if you still have issues - please let myself and anhu (he is another dev. adviser here) know.