metrics: add iOS support for Metrics.density/Metrics.dpi

This commit is contained in:
Mathieu Virbel 2012-11-02 20:06:21 +01:00
parent 596cbab408
commit 42fb4c69c5
1 changed files with 6 additions and 0 deletions

View File

@ -156,6 +156,9 @@ class Metrics(object):
if platform() == 'android':
import android
return android.get_dpi()
elif platform() == 'ios':
import ios
return ios.get_dpi()
# for all other platforms..
from kivy.base import EventLoop
@ -189,6 +192,9 @@ class Metrics(object):
import jnius
Hardware = jnius.autoclass('org.renpy.android.Hardware')
return Hardware.metrics.scaledDensity
elif platform() == 'ios':
import ios
return ios.get_scale()
return 1.0