Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement OS.get_screen_dpi() on iOS #36628

Closed
HEAVYPOLY opened this issue Feb 28, 2020 · 6 comments
Closed

Implement OS.get_screen_dpi() on iOS #36628

HEAVYPOLY opened this issue Feb 28, 2020 · 6 comments

Comments

@HEAVYPOLY
Copy link
Contributor

Godot version:
3.2 stable
OS/device including version:
iOS
Issue description:
OS.get_screen_dpi(OS.get_current_screen()) yields wrong value on iOS
using iPad Pro first generation, dpi is returned as 72, when in reality it is 264
Same code works correctly on MacOSX, Windows, and Android devices
Steps to reproduce:

Minimal reproduction project:

@Calinou
Copy link
Member

Calinou commented Feb 28, 2020

get_screen_dpi() isn't implemented on iOS, which means the fallback value of 72 is returned.

This is already documented here:

[b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. Returns [code]72[/code] on unsupported platforms.

@Calinou Calinou changed the title iOS OS.get_screen_dpi() dpi incorrect value Implement OS.get_screen_dpi() on iOS Feb 28, 2020
@HEAVYPOLY
Copy link
Contributor Author

Thanks for the clarification, excited for this enhancement!

@ViktorEvil
Copy link
Contributor

Need this for a pixel art game I’m making for iOS, my scaling script to get pixel perfect art has different results on devices that use @3 resolution. My workaround involves using OS.get_model_name and setting the scaling depending on a list of all iOS devices but this isn’t a very elegant solution

@naithar
Copy link
Contributor

naithar commented Mar 1, 2021

Was implemented for 3.2 in #42582. Should be available in 3.2.4 RCs.
@HEAVYPOLY can you please check if it's working?

@HEAVYPOLY
Copy link
Contributor Author

@naithar getting correct 264 dpi on 1st gen iPad Pro. Thank you!

@Calinou
Copy link
Member

Calinou commented Sep 20, 2021

This was implemented in 3.3 and later per the above comment, closing.

@Calinou Calinou closed this as completed Sep 20, 2021
@Calinou Calinou added this to the 3.3 milestone Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants