Screen Orientation / Content Scaling not working on Android

Hi,

since the latest release of Corona with all the content scaling options, all my apps I've made for Android are looking weird on the device. I've set the screen orientation to landscape in the build.settings:

1
2
3
4
5
6
settings = {
orientation = {
default = "lanscapeLeft",
supported = { "landscapeLeft","landscapeRight"},
},
}

What happens if you comment out the xAlign and yAlign parameters or change the scale to "none"?

Can you post some sample code to demonstrate the problem?

Thanks,
-Tom

I did what you said and tried to switch the height/width but nothing really changed. I tried to do a little sketch of what's going on exactly:

Well it's hard to post some sample code, because no matter what I'm actually doing inside the main.lua file, it won't show up correctly on the device. I tried to load a simple image (display.newImage ...) but I'm having the same problem.

I don't have any clue what's wrong with the config.lua.

Hope we'll find a solution.

- Michael

The bottom two modes (width = 480 and height = 320) are not valid. The width and height refer to the device portrait mode even if your app runs in landscape mode.

Try this to see if it helps:

1
2
3
4
5
6
settings = {
orientation = {
default = "landscapeRight",
supported = {"landscapeRight"},
},
}

I changed the build.settings as you told but the results are still the same. Argh I really don't know what else there could be wrong. Are there any other Android users with the same issue? I tried almost every combination but I really think this is a bug inside of Corona because in the latest Alpha of the Game Edition everything was working just fine! Even with the wrong landscapeLeft and landscapeRight settings.

Do you guys at Corona even test those things on Android? I don't think that I'm the only one who's having these issues...

I tried some other things in portrait mode, and as I mentioned in my first post, the hitTest isn't working at all. I think this has got something to do with all that content scaling stuff too.

Hope you can either fix the bug or help me to fix it :-)

Thank you for the quick response,

Michael

Ok,

I tried several other things, I compiled the app with the Corona Game Edition Alpha 3 and it's looking just fine on my HTC Legend but the HitTest isn't working either. Then I compiled it with the Corona Game Edition Alpha 2 and - what a surprise - everything works fine. Well what I'm asking myself now is, what have you changed that messed up the hittest and the landscape mode?

I think the hittest and the content scaling are both very important features of the Game Edition and it's a pity that they aren't working on Android.

Hope you'll find a solution for that!

- Michael

Your original comments mentioned Corona and didn't say anything about Game Edition so I've tried to reproduce your problem using the released Corona SDK.

There were landscape issues with Android that was fixed in the Corona SDK release and those changes will be in the upcoming Game Edition release.

I've tried to reproduce your landscape issue here and everything works fine on the Corona Simulator and a Nexus One device using the Corona SDK. We don't have a HTC Legend so it may be device specific. I also don't have the code you're testing with so my test code may not reproduce the problems you're seeing.

There has been a lot of changes between Alpha 2, 3 and the beta release.
Is it possible to zip up a small sample code project that demonstrates the orientation and hittest problems? That would help us determine what is not working and if the new release fixes the problem. You can send it to tom @ anscamobile.com

Thanks,
-Tom

Hi,

thank you for your response! Sorry for the little confusion with the Corona SDK and the Game Edition. I am using the Game Edition for all my projects. I haven't tried it yet with the Corona SDK but I need the Box2D Physics in my projects, so I must use the Game Edition.

I'll pack one of my projects and send it to you. Thank you for your help!

- Michael

Thanks for sending in the code.

I confirmed that the orientation problem is fixed in the upcoming GE release. The Android orientation problems were fixed in Corona SDK and that code base will be in the new GE release.

I'm still trying to confirm the hittest problem.

-Tom

Wow, OK thank you!

One other thing that I noticed is (I think I mentioned it above) that if you place a finger on the screen and the eventlistener is fired, the whole physics engine slows down. Maybe this is something that's wrong inside my code but I don't know maybe it could be something inside the Game Edition too.

Do you know when roughly the new GE will be released?

Thank you very much!

- Michael

Michael are you still experiencing change in speed during touch events on Android?

I dont think its your code because lots of people are having this problem. I've made a ticket but havent heard anything back yet.

http://developer.anscamobile.com/issues/3150

views:1932 update:2011/10/9 22:34:50
corona forums © 2003-2011