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
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

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
36
S
14
G
5
Posts: 239
Reputation: 5,648

Post » Fri Dec 02, 2016 6:05 pm

Yes - almost all features work identically across all platforms.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], Kin and 36 guests