Page 1 of 1
Android Orientation
Posted: Thu Jan 07, 2016 6:01 am
by Ensayia
Don't know if this belongs here or in Android, now that the projects have sort of merged.
Is there any easy way to set portrait / landscape orientation when loading a game on Android? I don't see anything in the wiki about it.
Thanks!
Re: Android Orientation
Posted: Thu Jan 07, 2016 5:03 pm
by CanadianGamer
I don't think there is a way to easily do that.
I guess you could change that when building into an apk
but other than that I don't think so.
Re: Android Orientation
Posted: Thu Feb 18, 2016 10:24 am
by monolifed
Is there a way to tell screen orientation?
Löve seems to prefer landscape orientation
Re: Android Orientation
Posted: Thu Feb 18, 2016 4:17 pm
by D0NM
ingsoc451 wrote:Is there a way to tell screen orientation?
Löve seems to prefer landscape orientation
have you seen this?
viewtopic.php?f=4&t=81634&p=193732&hili ... pe#p193732
Re: Android Orientation
Posted: Thu Feb 18, 2016 7:44 pm
by bobbyjones
I build it in landscape automagically. It can also be built in a way that can be auto, auto-landscape,auto-portrait(I think), and portrait. You would just have to set it in the manefest(I can't spell today) I believe. I suggested to slime that I can write code to make it possible to be changed in app but SDL handles the window creation and such in love. So the change has to be made in SDL for love to support it on Android. It is supported in SDL for iOS tho.
Re: Android Orientation
Posted: Thu Feb 18, 2016 11:00 pm
by monolifed
I didn't see it. Thank you.
Re: Android Orientation
Posted: Fri Feb 03, 2017 8:09 pm
by bgordebak
I did a simple hack for this. I don't know if it'll be a problem when I release the game, but right now it works. Here's how it goes:
Code: Select all
function love.draw()
screen_width = love.graphics.getWidth()
screen_height = love.graphics.getHeight()
if screen_width < screen_height then
orientation = "portrait"
else
orientation = "landscape"
end
--draw accordingly
end
Re: Android Orientation
Posted: Mon Feb 06, 2017 7:44 am
by bgordebak
You can change your AndroidManifest.xml so that android:screenOrientation is "unspecified" or "portrait". It's fairly easy.
It works fine for me.