Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / iOS Landscape mode from App start - How?

Author
Message
pinete
13
Years of Service
User Offline
Joined: 28th Jul 2011
Location:
Posted: 13th Dec 2017 08:28 Edited at: 13th Dec 2017 15:29
Hi guys,
I need some help regarding a key subject for me now.
I know it has been discussed some time in the forums but I've not been capable of getting/finding a solution or a conclusion.

I need my app start in Landscape mode in iOS, from the beginning.
I don't need it changes automatically from landscape to portrair or so during execution.. I just need it starts from the beginning in Landscape, and after that, running landscaped all the way.
No matter if the solution come from inside AppGameKit or touching/changing any other variable, internal, external, file or whatever it be in any other file, generated, xcode, whatever..

I readed a post in which it was explained that apparently the app starts always in portrait in iOS and then once you turn the device, landscape mode get locked and the it work in landscape all the time.

So my question is how can I do the app start in landscape, just that, I don't need to change from portrait to landscape and so once the app is running.
I'd really appreciate some help
Thanks a lot in advance!!!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Dec 2017 21:13 Edited at: 13th Dec 2017 21:14
Try SetOrientationAllowed()
I think you can set the initial orientation in the export dialog from the agk editor as well
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 14th Dec 2017 09:44
As blink said, use setorientationallowed(0,0,1,1) but I also recommend adding a repeat until getdevicewidth() > getdeviceheight()
After as sometimes the screen will be the wrong dimensions otherwise.
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
pinete
13
Years of Service
User Offline
Joined: 28th Jul 2011
Location:
Posted: 14th Dec 2017 20:26
Thanks a lot guys,
try that but the iphone needs that player turns intentionally the mobile from portrait to landscape, then the app starts and it's good from that moment on..
But what I need is that the app don't need any interaction from user, it need to start directly in landscape without the user turn anything or move the mobile.
It works in android, but in iOS it seems that by default app always start in portrait even with the SetOrientatioAllowed command..
I've tried this several times.
Does it work for anyone? am I doint somethign wrong?
Any other workaround or clue, please?
pinete
13
Years of Service
User Offline
Joined: 28th Jul 2011
Location:
Posted: 14th Dec 2017 22:58
This is what I found in the description of the command "SetorientationAllowed"

Quote: "
If you use T1 for a landscape only iOS game, you need to uncommente the line

#define AGK_LANDSCAPE

in <yourproject>/classes/untitledcontroller.m

If you don't do it, when the device in portrait mode as you start a game, it doesn't force landscape mode.

In your program, use those commands :

SetVirtualResolution(1024,768)
SetOrientationAllowed(0,0,1,1)
sync()
"


That's what I refer to, my game is only Landscape, and wait to the player change the position or force him to do it through a message or so seems very rough, that's the reason I'm looking the way to do it at the beggining but no in realtime during game execution, as said, I'm not interested in that.

What I don't undertand very well is Where would I find

Quote: "
#define AGK_LANDSCAPE
in <yourproject>/classes/untitledcontroller.m
"


to change it as the instructions state.

Someone as tried something similar? any more help please?

Login to post a reply

Server time is: 2024-11-24 06:10:51
Your offset time is: 2024-11-24 06:10:51