Image Not Placed Same For Different Device

Hello,

 

I am adding an image at 0,0 and when I select to view the app with different devices using the View As menu item in the simulator the image is moved up and down depending on the device selected. If I select Droid the image is moved down some with a bif space of margin at the top. If I them select iPad it is actually off the screen a little at the top. The image is just a jpg logo sized at 130x49. I am using the following code to place it:

 

 imgHome = display.newImage( "logo\_wub.jpg" ,0,0) screenGroup:insert( imgHome )

 

 

Thanks for any help!

 

Warren

Attached is an example of what I mean. I changed the code to not even have the 0,0 coordinates so it should be placed there anyways. And for the Droid view it is not even at the top of the screen. The background image I had to place the Y at a negative value to reach the top. Why is this? But then on iPad or others the logo is at the top or beyond.

 

Thanks!

 

imageissue.jpg

Hi Warren,

Depending on your settings in “config.lua”, coordinate (0,0) is not always in the same place on every device. Because of the considerable differences in screen sizes and aspect ratios, you need to set up a display/coordinate solution that will suit your needs and work nicely on the devices you’re targeting.

Here are some resources to help, if you haven’t seen them yet:

http://docs.coronalabs.com/guide/basics/configSettings/index.html

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

Brent

Thanks Brent! I read both of them and from what I understand by setting the xalign to left and yalign to top that put the x/y coordinates on the screen to the top left of the screen? I tested it and when viewing it as all devices it displayed right.

 

Warren

Attached is an example of what I mean. I changed the code to not even have the 0,0 coordinates so it should be placed there anyways. And for the Droid view it is not even at the top of the screen. The background image I had to place the Y at a negative value to reach the top. Why is this? But then on iPad or others the logo is at the top or beyond.

 

Thanks!

 

imageissue.jpg

Hi Warren,

Depending on your settings in “config.lua”, coordinate (0,0) is not always in the same place on every device. Because of the considerable differences in screen sizes and aspect ratios, you need to set up a display/coordinate solution that will suit your needs and work nicely on the devices you’re targeting.

Here are some resources to help, if you haven’t seen them yet:

http://docs.coronalabs.com/guide/basics/configSettings/index.html

http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/

Brent

Thanks Brent! I read both of them and from what I understand by setting the xalign to left and yalign to top that put the x/y coordinates on the screen to the top left of the screen? I tested it and when viewing it as all devices it displayed right.

 

Warren