Page 32 of 33

Re: love-android-sdl2 (native, 0.9.0)

Posted: Wed May 27, 2015 8:45 pm
by Positive07
TurtleP wrote: Thanks, I must have read the documentation wrong or something.
No problem, can happen to anyone, also that part of the docs where really confusing to me too, they are described right, but it is hard to imagine it hahaha. Good luck with that! It's looking rather nice :D

Re: love-android-sdl2 (native, 0.9.0)

Posted: Thu May 28, 2015 4:06 am
by TurtleP
Positive07 wrote:
TurtleP wrote: Thanks, I must have read the documentation wrong or something.
No problem, can happen to anyone, also that part of the docs where really confusing to me too, they are described right, but it is hard to imagine it hahaha. Good luck with that! It's looking rather nice :D
Thanks! Yeah I made my own touch screen controls (and used Hugo's android analog library too) for this. It's going to detect mobile mode (Android/iOS) or desktop mode (PC/Mac/Linux) and apply various settings when needed.

One other problem, however, is that enemies are spawned as such (and only breaks in fullscreen mode!) and thus the game does not position things correctly for each device during the online co-op due to the scale and screen resolutions. Any advice on how to fix that?

Re: love-android-sdl2 (native, 0.9.2)

Posted: Fri May 29, 2015 11:22 am
by T-Bone
While your post doesn't quite make it clear exactly what the problem is, it sounds like you're sending positions (of enemies and such) in pixel coordinates. Don't do that! Anything going over a network should be in resolution-independent coordinates that work on any client.

Re: love-android-sdl2 (native, 0.9.2)

Posted: Fri May 29, 2015 4:54 pm
by TurtleP
T-Bone wrote:While your post doesn't quite make it clear exactly what the problem is, it sounds like you're sending positions (of enemies and such) in pixel coordinates. Don't do that! Anything going over a network should be in resolution-independent coordinates that work on any client.
Yeah, that's probably my issue. Any tips on how to fix the issue?

These are snippets of my code, I'm not asking for you to change it for me, but just let me know why it's wrong (obviously using l.w.getWidth is one thing) and all positions are scaled on drawing, never during update functions.

My code for enemies (using cron for the timer):

Code: Select all

enemyclock = cron.every(cron_time, function() newenemy(love.math.random(5, (love.window.getWidth()/scale)-32), 0) end)
and all bosses position themselves in the center of the screen, so for example the first boss:

Code: Select all

boss:new((love.window.getWidth())/2-(bossimg:getWidth()*scale)/2, -60)
who moves around left and right a lot.

Yeah the code looks pretty bad, but it's old from around the first few revisions of the game.

Re: love-android-sdl2 (native, 0.9.2)

Posted: Tue Aug 18, 2015 8:13 pm
by Ranguna259
How to I change the screen's orientation ? I've tried changing it in AndroidManifest.xml but when I repack and install I get an error saying that the app couldn't be installed.
Can you compile version 0.9.2b in portrait mode and post it here ?

Re: love-android-sdl2 (native, 0.9.2)

Posted: Tue Aug 18, 2015 9:46 pm
by Nixola
Weird, I remember changing the orientation (and other things, too!) in the file manually without issues. How and on what system are you doing this?

Re: love-android-sdl2 (native, 0.9.2)

Posted: Tue Aug 18, 2015 10:31 pm
by Ranguna259
I'm doing this on windows and I'm using apktool 2.0.1 with the following commands:

Code: Select all

apktool d LOVE_for_android_0.9.2a.apk
Then I change the orientation to portrait in the xml and run this command:

Code: Select all

apktool b LOVE_for_android_0.9.2a -o newlove0.9.2a.apk
After that I move newlove0.9.2a.apk to my phone but it fails to install.

Here's the modified apk.

Re: love-android-sdl2 (native, 0.9.2)

Posted: Mon Aug 24, 2015 12:09 pm
by Ranguna259
Anyone ?

Re: love-android-sdl2 (native, 0.9.2)

Posted: Sat Sep 12, 2015 7:29 am
by Firstport
https://love2d.org/imgmirrur/hmS3snB.png

So ive followed the detailed step by step. Exact but the /tools/ant.build.xml
Fails my build everytime at 538. While running the .bat command in the correct sdl2 root folder

MinSdkVersionOut I believe is around that line using notepad++

Unable to resolve project target Android-19

Probably a simple mistake that needs changing of targets, ive only made hello worlds before

Re: love-android-sdl2 (native, 0.9.2)

Posted: Tue Sep 29, 2015 4:21 pm
by L13B3
Hey you all!

I just jumped aboard the Lövetrain <3
After successfully running "official" Löve for Android on my phone and booting my game, I decided I'd rather portrait mode than landscape. So I changed the AndroidManifest setting and repacked and installed and the game ran again, but ran into a few small things.

First off, I couldn't run games from /sdcard/lovegame. It worked when I used adb to push it and then run the shell, but not when normally running the app on my phone, which is peculiar. It lieu of a quicker workflow, I've returned to the official so I can make some progress quicker, hoping someone here could potentially know what's wrong with that?

Second, when I put it in portrait mode, the touchpressed, released and moved seemed to return x and y in terms of pixels rather than the usual [0,1] and I cannot for the life of me guess why that is.

Any thoughts?
Thanks! :)