ad banners on different sized devices

So I’m just about ready to publish my app but I’ve run into a problem. I’m using the zoomStretch scale option in my config.lua so the app scales to fit the device. Everything works fine accept for when I display ad banners. The banners look good on some devices but take up too much space on others.

I understand that ads don’t scale with the device so I wanted to decide which ad size to use based on the screen resolution. The problem is that I don’t know how to get the device’s actual resolution display.contentWidth only gives me the value set in the config file.

How would I go about getting the device’s actual resolution? Is there another approach I should take to deciding what ad banner size to use? I’ve been doing most of my testing on Android though I plan to eventually publish for IOS as well.

Thanks,

Erik [import]uid: 45650 topic_id: 35502 reply_id: 335502[/import]

See display.pixelWidth and display.pixelHeight which should return the physical pixels of the device and should help you out.
[import]uid: 199310 topic_id: 35502 reply_id: 141129[/import]

Exactly what I was looking for, thank you! [import]uid: 45650 topic_id: 35502 reply_id: 141356[/import]

See display.pixelWidth and display.pixelHeight which should return the physical pixels of the device and should help you out.
[import]uid: 199310 topic_id: 35502 reply_id: 141129[/import]

Exactly what I was looking for, thank you! [import]uid: 45650 topic_id: 35502 reply_id: 141356[/import]