You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: