How do I lock the screen orientation to landscape during a scene in cocos2d? - ios4

I am using box2d for ios app development.I would like to fix device orientation to landscape left which comes default in cocos2d.
How would I go about locking the screen orientation so that it cannot be changed while the user is playing?

Here's the answer to your question:
System ignore iPhone rotation
You tell the OS to ignore system rotations.

In Cocos2D open the GameConfig.h and change the Autorotation macro according to its documentation to disable autorotate support.

Related

Android Virtual Keyboard affect screen rotation ( Using Cocos Creator to build )

I using Cocos Creator 3.5.2 for this project.
When I start testing input text field in android phone either in app or web browser, after the virtual keyboard appear and I try rotate screen from landscape to portrait, the keyboard got change but the screen layout dint resize still is landscape but only smaller n at top.
It need to close the keyboard then the screen layout will start resize and this is in app.
Any idea that can cause this happen?
And any solution for it.

Apportable wrong orientation

It looks like everything is going to work..
My game compiles and successfully creates a running android version.
It is just in the wrong orientation. It show up in landscape when it should be portrait.
The Apportable Beta splash screen also shows up in landscape when it should be in portrait.
I correctly chose 1 and p when I first started.
Is there any way to get my game turned to portrait and the splash screen as well.
Make sure your info.plist indicates that you only support portrait orientations.
Additionally, make sure that info.plist is present in <you project>.approj/targets/<your target>/Release.final under the infoplists key.

Virtual buttons not appearing on emulated Android 4.2 system

I have created an Android 4.2 AVD. For the need of my current project, the main screen orientation is landscape. The software keys option is selected.
The mode is set to xhdpi, like a Galaxy Nexus phone.
As I start the emulator, I see a black stripe on the right where the buttons should appear, but it remains black. Thus, there is no way to trigger a Back action since the emulated physical keys are disabled.
The problem can be fixed by configuring the emulator in portrait mode then rotate it once started; the buttons appear as expected. This causes problems since the window is automatically scaled down to fit on my monitor; I did not find any shortcut to restore 1:1 scaling at runtime, after the rotation is done. This is important since I would like to see pixel-perfect results.
I am using SDK version 21 and platform-tools version 16.0.2, as updated yesterday.
Found the solution myself... this is a workaround that allows getting 1:1 scale and the software buttons working.
Leave the AVD (Galaxy Nexus or cloned from it) on portrait mode.
Run the emulator from the command line, using the -scale 1 option; this is the magic that forces 1:1 pixel perfect ratio even if the window does not fit in screen at startup. By default, automatic downsizing happens to fit the monitor.
Rotate the display using Ctrl+F11 or Ctrl+F12 to get landscape mode.

Android wallpaper also sliding left and right when we swipe the home screen

I want to develop a new home screen application for android. I saw the default home screen in my android 2.3.3 device, when ever I swipe the home screen left and right, the background wallpaper also sliding left and right. What is that view? How to get the same effect in an app?
Is it ViewPager? I checked the ViewPager class, but I didn't found any common background image for all views in that.
You probably want to use a canvas with a draw-able, then detect the users swiping and animate it in the background. It is likely that the default android backgrounds are doing the same. You wont be drawing the unseen portions of the view.
http://developer.android.com/guide/topics/graphics/2d-graphics.html
I suggest doing their lunar lander tutorial to learn how to use the canvas first.
You will make a canvas the background to your app and then lay your other ui elements on top of it unless you make the ui based inside the canvas.

J2ME, LWUIT (V. 1.2) - Menu bar from bottom to the right of the screen!

I'm working with the mobile graphic framework LWUIT (V. 1.2) to develop an application for Nokia N97.
Results are striking and elegant but I have a problem: when I rotate mobile screen, menu bar doesn't switch from bottom to the right of screen. Commands remain on the bottom while correspondent mobile buttons are now on the right...
Is there an event that I can intercept when the user open or rotate mobile screen? Or I have to extend some library class to make this behaviour automatic? Or anithing else?
Anyone of you can describe a solution?
Thanks in advance
I didn't use LWUIT much, but you can insert following parameter to jad:
Nokia-MIDlet-App-Orientation: portrait
This should disable auto-rotating on Nokia S60 5th.
If you want to catch an event when the screen rotates, you can check canvas.getWidth() and canvas.getHeight(). If device's screen is not square, its width and height should change.

Resources