iPad scales different than all other simulators

I have the following config.lua

application = { content = { width = 160, height = 240, scale = "letterBox", xAlign = "left", yAlign = "top", fps = 60 } }

And I calculate the width and height by the following code:

print("actualContentWidth = "..math.floor(display.actualContentWidth + 0.5)) print("actualContentHeight = "..math.floor(display.actualContentHeight + 0.5))

Our game is in landscape mode and on every device I get the height of 160px and only the width will change

But on the iPad the height is 180px

Is this supposed to happen? Is this the only device that will have a different height? Is there a way to also let the iPad take the same height as all other devices?

It’s the aspect ratio of the iPad which results in “letterbox” apps to have extra height available. You’ll need to calculate the extra width / height on different devices in letterbox mode.

I’m not sure what your criteria are but you could try “zoomEven” if you don’t like the letterBox effect.

If I try zoomEven it works like this on common devices:
 

iPhone 4

actualContentWidth = 240    
actualContentHeight = 160

iPhone 5

actualContentWidth = 240    
actualContentHeight = 135

iPad

actualContentWidth = 213    
actualContentHeight = 160

If I use letterbox it works like this:

iPhone 4

actualContentWidth = 240    
actualContentHeight = 160

iPhone 5

actualContentWidth = 284    
actualContentHeight = 160

iPad

actualContentWidth = 240    
actualContentHeight = 180

So with zoomEven the height of an iPhone 5 will be treated differently

and with letterBox the height of an iPad will be treated differently

and zoomStretch for sure wont work

Hmm any other options to let the height always be a consistent value?

Sorry, but that’s not possible. Content scaling doesn’t work like that. You need to take the aspect ratios into consideration. I recommend using letterbox as it guarantees that your content is always visible. However you do need to calculate any extra width / height that will occur on different devices. 

Ah ok, thats no problem

Thanks for your help!

It’s the aspect ratio of the iPad which results in “letterbox” apps to have extra height available. You’ll need to calculate the extra width / height on different devices in letterbox mode.

I’m not sure what your criteria are but you could try “zoomEven” if you don’t like the letterBox effect.

If I try zoomEven it works like this on common devices:
 

iPhone 4

actualContentWidth = 240    
actualContentHeight = 160

iPhone 5

actualContentWidth = 240    
actualContentHeight = 135

iPad

actualContentWidth = 213    
actualContentHeight = 160

If I use letterbox it works like this:

iPhone 4

actualContentWidth = 240    
actualContentHeight = 160

iPhone 5

actualContentWidth = 284    
actualContentHeight = 160

iPad

actualContentWidth = 240    
actualContentHeight = 180

So with zoomEven the height of an iPhone 5 will be treated differently

and with letterBox the height of an iPad will be treated differently

and zoomStretch for sure wont work

Hmm any other options to let the height always be a consistent value?

Sorry, but that’s not possible. Content scaling doesn’t work like that. You need to take the aspect ratios into consideration. I recommend using letterbox as it guarantees that your content is always visible. However you do need to calculate any extra width / height that will occur on different devices. 

Ah ok, thats no problem

Thanks for your help!