[Resolved] Maybe a bug: Scaling issues on iPod

Hi everybody,

When building my app for iOS, I’m experiencing some weird bug (?) regarding background images. For some reason, all backgrounds have a fixed size of half the iPod screen, regardless of their original size, but there are no issues with it on an iPad 2.

This does not apply to all images, only the ones I’ve been using for backgrounds. So images above 960x640, as far as I can tell, simply don’t display right on an iPod, regardless of the dynamic scaling method.

Is this a known bug, and is there a workaround for it? [import]uid: 117153 topic_id: 23523 reply_id: 323523[/import]

I believe the image is being downsized on the devices with lower resolutions.

Can you try;

myImage = display.newImage(“imageName.png”, true)

and let me know if the same occurs, please? :slight_smile: [import]uid: 52491 topic_id: 23523 reply_id: 94413[/import]

Hello Peach,
Thanks for your reply.

Disabling dynamic scaling does somehow solve the problem, yes.

However, the iPod I am using for testing does have the 960x640 resolution, and I would really like to dynamically scale the backgrounds according to different devices. Isn’t there some way I can make it scale to fill the screen regardless of resolution? [import]uid: 117153 topic_id: 23523 reply_id: 94421[/import]

Without your config.lua and image loading code for the affected images it’s hard to properly help you. [import]uid: 61899 topic_id: 23523 reply_id: 94468[/import]

As Clueless said config and image loading code would be a big help in offering advice here :slight_smile: [import]uid: 52491 topic_id: 23523 reply_id: 94672[/import]

There doesn’t seem to be anything particularly fancy about my setup.

config.lua (I tried it with many different resolutions, above and below 960x640)

application =  
{  
 content =  
 {  
 scale = "letterbox"  
 },  
}  

image loading code (without the “true” parameter)
i’m using director class

local background = display.newImage( "assets/img/menu/bg\_menu.png" ) localGroup : insert( background ) background.x = w \* 0.5 background.y = h \* 0.5 [import]uid: 117153 topic_id: 23523 reply_id: 94772[/import]

I really need some help on this, you guys.

Let me give you another example:

  • I have an image which is 1920x1280 pixels (double the size of the current ipod screen):
local image = display.newImage ( "image.png" ) -- this is 1920x1280  
  • I write in the config.lua file:
application =  
{  
 content =  
 {  
 width = 1920,  
 height = 1280,  
 scale = "letterbox"  
 },  
}  
  • What I get on the simulator is an image about 80% the size of the screen.

I am thinking there’s something fundamental about dynamic scaling I don’t get. If I set the scaling dimensions to the exact dimensions of the image, why is it still smaller than the screen? [import]uid: 117153 topic_id: 23523 reply_id: 95609[/import]

OK, I think this was a serious brain fart. I confused width and height, since my app only runs in landscape mode.

I have been struggling with this for days, I feel like such an idiot :smiley: [import]uid: 117153 topic_id: 23523 reply_id: 95610[/import]

Good Morning :slight_smile:

Haha, well, we all make silly little mistakes like that sometimes - it’s easy to do.

Glad you figured it out!

Peach :slight_smile: [import]uid: 52491 topic_id: 23523 reply_id: 95642[/import]

Side note: Are you planning on using an image that size in your actual app? [import]uid: 52491 topic_id: 23523 reply_id: 95643[/import]

We were for the iPad3, but it doesn’t seem like a fantastic idea. We’re saving it for the PC version. What’s wrong with it, though? [import]uid: 117153 topic_id: 23523 reply_id: 95647[/import]

If it’s just for iPad 3 that’s fine - I thought you were perhaps trying to use an image that large on an iPod version, which would be bad. (Texture memory usage and whatnot.) [import]uid: 52491 topic_id: 23523 reply_id: 95671[/import]

I thought so :slight_smile:

Thanks for your help, I appreciate it a lot. [import]uid: 117153 topic_id: 23523 reply_id: 96200[/import]

Not a problem, always happy to help when I can.

Good luck with your project!

Peach :slight_smile: [import]uid: 52491 topic_id: 23523 reply_id: 96243[/import]