Hoto Landscape on device??

Monkey Targets Forums/Android/Hoto Landscape on device??

vmakar85(Posted 2012) [#1]
Good day and night for all residents forum!
Please help me. How to change the screen orientation to landscape!

I just started studying monkeys, and gathered the example of bananas (hours) and can not figure out how to change the orientation of the screen!


therevills(Posted 2012) [#2]
Check this page:

http://blitz-wiki.appspot.com/App_config_settings

It's a bit out of date now, but check the Android section.


vmakar85(Posted 2012) [#3]
therevills thx for link - but no result, i add file into MonkeyPro\bananas\difference\clock\clock.build\android thet call CONFIG.TXT
and null result, i got same old mankey_game_***debug.app

my config.txt file :
ANDROID_APP_LABEL:String="Clock"
ANDROID_APP_PACKAGE:String=com.Clock
ANDROID_SCREEN_ORIENTATION=landscape
ANDROID_NATIVE_GL_ENABLED=false

where I could make a mistake


devolonter(Posted 2012) [#4]
Hi,

Strange, it should work. Also, you can set this options in monkey code with hash. For example:
[monkeycode]
#If TARGET = "android" Then
#ANDROID_SCREEN_ORIENTATION="landscape"
#End
[/monkeycode]
It works fine for me.


Gerry Quinn(Posted 2012) [#5]
You need inverted commas I think:

ANDROID_SCREEN_ORIENTATION="landscape"

And as devolunter says, you need # at the start if you put it in code (which is way more convenient IMO, just stick it at the start of your main app file).

You don't need #IF TARGET = "android", though: it will just ignore the directive if you are compiling for a different target.


Xaron(Posted 2012) [#6]
And you don't have config.txt files anymore but config.monkey!


devolonter(Posted 2012) [#7]
Ah, yes! Xaron is right CONFIG.TXT now renamed to CONFIG.MONKEY and must contain valid monkey code.


therevills(Posted 2012) [#8]
That's why I said the link was out of date ;)

@devolonter, btw you don't have to wrap the precompiler stuff with the target checks.


vmakar85(Posted 2012) [#9]
config.monkey - work =)) many tnx for help


caffeinekid(Posted 2013) [#10]
Can you decide which way up the orientation is? Can you swap in game - for instance if you were making a two player game and wanted to rotate the screen 180 degrees each time a player makes a move to swap to player 2, etc?


MikeHart(Posted 2013) [#11]
Nope, not automatically. You need to do this in your app by rotating your content.


Midimaster(Posted 2013) [#12]
but.. the content will swap 180°, when the auto rotation is activated and the user cants the tablet...