Using web popups across different devices

If I configure a web popup to show text at a certain size suitable for an iPhone screen, it appears too small when viewed on an iPad or Retina display. Does anyone know of any JavaScript or other techniques to adjust a font size appropriately for different devices?

Thanks! [import]uid: 43692 topic_id: 29317 reply_id: 329317[/import]

You can check the device type or the screen size and adjust accordingly with Lua.

[lua]realWidth = (display.contentWidth - (display.screenOriginX * 2)) / display.contentScaleX
realHeight = (display.contentHeight - (display.screenOriginY * 2)) / display.contentScaleY

print (realWidth, realHeight)[/lua]

Peach :slight_smile: [import]uid: 52491 topic_id: 29317 reply_id: 117890[/import]

I dont think this would work for changing the font size within a web view or popup. I currently set the size using CSS, but as mentioned this results in a much smaller text size on Retina displays. However I want the size of the web view area to be the same pixel dimensions on the screen. [import]uid: 43692 topic_id: 29317 reply_id: 117896[/import]

Oh apologies, saw in dev support and misunderstood. I’m unsure how web developers handle this, I will attempt to have a play with it later (time permitting) and see if I can come up with anything.

Else, hopefully someone else has dealt with this in the past with their own site. [import]uid: 52491 topic_id: 29317 reply_id: 117998[/import]

I’ve found that by using

<meta name="viewport" content="user-scalable=no, width=275">

it then makes the text a more manageable size on all platforms. [import]uid: 43692 topic_id: 29317 reply_id: 118000[/import]

Glad to hear that.

FYI - I just edited your post. If posting code you need to use < code > and < /code > tags to have it actually show up.

Peach :slight_smile: [import]uid: 52491 topic_id: 29317 reply_id: 118138[/import]