module to lock the screen orientation during run time for Android

grant

Member
CX Code Contributor
3rd Party Module Dev
3rd Party Tool Dev
Joined
Nov 19, 2019
Messages
80
This module lets you lock (or unlock) the orientation of the game at any time.

lockorient.lockOrientation:Void(landscape:Bool, portrait:Bool, landscapeFlipped:Bool, portraitFlipped:Bool)
Lock to most any combination of orientations.​

Demo: The included demo.cxs locks the orientation to different values when you tap the screen.

Install: extract the zip file inside the modules_ext folder inside your Cerberus X installation folder.

License: zlib/libpng (see included license.txt)
 

Attachments

  • Lock-Orientation-module-V1.0-for-Cerberus-X-for-Android.zip
    2.4 KB · Views: 29

SLotman

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jul 3, 2017
Messages
214
But... why? You can just set the orientation in AndroidManifest.xml and forget about it.
I really never saw an app/game that needed to 'lock' orientation on the fly...

(I'm honestly asking - would like to know a use case for this!)
 

grant

Member
CX Code Contributor
3rd Party Module Dev
3rd Party Tool Dev
Joined
Nov 19, 2019
Messages
80
I mostly plan to make 3D platformer/shooter/action games with Cerberus X. I noticed once when working on one of my games before that it would be pretty cool to play them in portrait (kinda like a gameboy with the buttons below the game view), but I know this would annoy some players, so I'm going to offer a lock to landscape on/off setting.
 
Top Bottom