How do I get DPI of device?

Get help using Construct 2

Post » Fri Dec 02, 2016 10:26 am

Hi guys, I try to add AdMob smart banner to my app, but I need to know screen resolution in dp (independet-pixel density). So I need to know DPI of user's screen.
There is cocoonIO plugin with this expression, but it's not working. How can I do that? Thanks for any help.
B
6
Posts: 4
Reputation: 260

Post » Fri Dec 02, 2016 12:08 pm

The browser object's devicepixelratio expression gives you the ratio - the DPI typically refers to dots per inch, which is not usually as useful.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Fri Dec 02, 2016 1:22 pm

Thank you Ashley, that's help a lot.
B
6
Posts: 4
Reputation: 260

Post » Fri Dec 02, 2016 1:29 pm

Does it also work when the game is turned into an app for android or iOS ?
B
32
S
14
G
5
Posts: 232
Reputation: 5,502

Post » Fri Dec 02, 2016 6:05 pm

Yes - almost all features work identically across all platforms.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240


Return to How do I....?

Who is online

Users browsing this forum: FlyingRam, jkmalau, MadSpy, Manubis and 12 guests