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!
Android Orientation
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- CanadianGamer
- Party member
- Posts: 132
- Joined: Tue Jun 30, 2015 1:23 pm
- Location: Canada
- Contact:
Re: Android Orientation
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.
I guess you could change that when building into an apk
but other than that I don't think so.
My serious itch.io page:
https://pentamonium-studios.itch.io/
My less serious itch.io page:
http://canadiangamer.itch.io
https://pentamonium-studios.itch.io/
My less serious itch.io page:
http://canadiangamer.itch.io
Re: Android Orientation
Is there a way to tell screen orientation?
Löve seems to prefer landscape orientation
Löve seems to prefer landscape orientation
Re: Android Orientation
have you seen this? viewtopic.php?f=4&t=81634&p=193732&hili ... pe#p193732ingsoc451 wrote:Is there a way to tell screen orientation?
Löve seems to prefer landscape orientation
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
-
- Party member
- Posts: 730
- Joined: Sat Apr 26, 2014 7:46 pm
Re: Android Orientation
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
I didn't see it. Thank you.D0NM wrote:have you seen this? viewtopic.php?f=4&t=81634&p=193732&hili ... pe#p193732ingsoc451 wrote:Is there a way to tell screen orientation?
Löve seems to prefer landscape orientation
Re: Android Orientation
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
Last edited by bgordebak on Tue Feb 07, 2017 3:13 pm, edited 1 time in total.
Re: Android Orientation
You can change your AndroidManifest.xml so that android:screenOrientation is "unspecified" or "portrait". It's fairly easy.
It works fine for me.
It works fine for me.
Who is online
Users browsing this forum: Bing [Bot] and 1 guest