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

Make Constant Physical Size UI Scalling Mode #1293

Open
DiogoMendonc-a opened this issue Jul 24, 2024 · 0 comments
Open

Make Constant Physical Size UI Scalling Mode #1293

DiogoMendonc-a opened this issue Jul 24, 2024 · 0 comments
Labels
A-Engine B-UI S-Triage Issues whose priority still has to be figured out

Comments

@DiogoMendonc-a
Copy link
Contributor

We can already have the UI Canvas scale with different resolutions, but not with a screen's DPI. This means we cannot ensure elements keep the same physical size in different monitors.

A solution would be to scale the Canvas' virtual size with the screen's DPI, however, this is not trivial:

  • GLFW does not have a "get dpi" function. It does have a "contentScale", which allegedly promises to solve this issue, but it only returns the ratio between the screen's default and the screen's current DPI.
  • GLFW does have a function to get the physical size of the monitor, and we can find out its pixel size to, so that should allow us to calculate the DPI ourselves. However, this function does not work when the window is not in fullscreen. We would either need a method that works always, or decide on a default behaviour for windowed games.
  • The previous method is impossible to use as Cubos does not currently support fullscreen.
@DiogoMendonc-a DiogoMendonc-a added A-Engine S-Triage Issues whose priority still has to be figured out B-UI labels Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Engine B-UI S-Triage Issues whose priority still has to be figured out
Projects
None yet
Development

No branches or pull requests

1 participant