summaryrefslogtreecommitdiff
path: root/platform/android/java/src
diff options
context:
space:
mode:
authorMario Schlack <m4r10.5ch14ck@gmail.com>2016-07-20 14:54:48 +0200
committerMario Schlack <m4r10.5ch14ck@gmail.com>2016-07-20 14:54:48 +0200
commit07178937725d60e0f02050a3b39fc85e44c76b2d (patch)
treea80dc046e478807108665258ad3ccbed1f057d31 /platform/android/java/src
parent87d0515d0935d0af929feeef15fb704773cc4a12 (diff)
Implement get_screen_dpi() on Android
Diffstat (limited to 'platform/android/java/src')
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotIO.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/android/java/src/org/godotengine/godot/GodotIO.java b/platform/android/java/src/org/godotengine/godot/GodotIO.java
index 3e6919c2ad..55e330924a 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotIO.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotIO.java
@@ -40,6 +40,7 @@ import android.view.*;
import android.view.inputmethod.InputMethodManager;
import android.os.*;
import android.util.Log;
+import android.util.DisplayMetrics;
import android.graphics.*;
import android.text.method.*;
import android.text.*;
@@ -513,6 +514,11 @@ public class GodotIO {
return Build.MODEL;
}
+ public int getScreenDPI() {
+ DisplayMetrics metrics = applicationContext.getResources().getDisplayMetrics();
+ return (int)(metrics.density * 160f);
+ }
+
public boolean needsReloadHooks() {
return android.os.Build.VERSION.SDK_INT < 11;