Love for Android

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
jdawg68421
Prole
Posts: 1
Joined: Thu Apr 16, 2020 4:42 am

Love for Android

Post by jdawg68421 »

Hello!

I plan on building a game for mobile and would like to use LOVE. I plan on using the APK tool here https://love2d.org/wiki/Game_Distribution/APKTool

I am struggling to find any relevant documentation on building games in LOVE for mobile and have some questions.

1. What LOVE APIs should be used for mobile specific features (e.g. Touch APIs)
2. What LOVE APIs should be avoided/don't work well with Mobile?
3. What are the common gotchas/pitfalls with LOVE for Mobile?

Thanks :)
User avatar
AuahDark
Party member
Posts: 107
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: Love for Android

Post by AuahDark »

1. The only mobile-specific API is love.window.getSafeArea. It's used to retrieve areas which aren't obstructed by cutout. love.touch, love.touchpressed, and love.touchreleased aren't mobile-specific as it also work in Windows with multitouch-capable monitor.
2. Resizing window is not really possible in LOVE, but changing the screen orientation to portrait is possible by specifying portrait resolution (i.e. 9:16) and landscape orientation with landscape resolution (i.e. 16:9)
3. Android-specific: Canvas appear too big or image appear too big. This is because LOVE Android always have highdpi enabled and LOVE enables DPI scaling by default, which causes resolution returned by love.graphics.getDimensions() smaller than resolution returned by love.window.getMode(). You can workaround it by setting t.window.usedpiscale, but I personally prefer working with DPI-scaled units.
Profile. Do you encounter crashes in LÖVE Android and wanna send me logcats? Please hit me up in LÖVE Discord and send the full logcat file!
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 136 guests