Click or drag to resize

OSGetScreenDpi Method

Returns the dots per inch density of the specified screen. If screen is [/code]-1[/code] (the default value), the current screen will be used.

Note: On macOS, returned value is inaccurate if fractional display scaling mode is used.

Note: On Android devices, the actual screen densities are grouped into six generalized densities:

   ldpi - 120 dpi
   mdpi - 160 dpi
   hdpi - 240 dpi
  xhdpi - 320 dpi
 xxhdpi - 480 dpi
xxxhdpi - 640 dpi

Note: This method is implemented on Android, Linux, macOS and Windows. Returns 72 on unsupported platforms.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public static int GetScreenDpi(
	int screen = -1
)

Parameters

screen (Optional)
Type: SystemInt32

[Missing <param name="screen"/> documentation for "M:Godot.OS.GetScreenDpi(System.Int32)"]

Return Value

Type: Int32

[Missing <returns> documentation for "M:Godot.OS.GetScreenDpi(System.Int32)"]

See Also