mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 01:51:10 +00:00
Implement get_screen_dpi() on Android
This commit is contained in:
parent
87d0515d09
commit
0717893772
5 changed files with 37 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue