mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
[HTML5] Detect screen scale and DPI.
`OS.get_screen_scale` will now return the `window.devicePixelRatio` value, `OS.get_screen_dpi` uses CSS media queries to find approximate DPI value for the current display. `OS.get_screen_size` also return the actual screen size (not the CSS pixel size).
This commit is contained in:
parent
e9a25b8552
commit
6cff589b5b
4 changed files with 35 additions and 2 deletions
|
|
@ -136,6 +136,7 @@ public:
|
|||
Size2i screen_get_size(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
float screen_get_scale(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
|
||||
// windows
|
||||
Vector<DisplayServer::WindowID> get_window_list() const override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue