Prevailing wisdom on DPI scaling, windowsCOMPs in 2022

I’ve been trying to figure out what the best approach is for building UIs and pop up windows that work consistently well across screen sizes and scaling options, and although there are a number of discussions about this, the last time it was talked about in the forums seems to be 2020, and with the vulkan integration and slug library in 2022, I’m trying to figure out what info is most relevant.

I have several workstations, with a variety of resolution configurations that I would like my UIs to behave consistently across. At home, I use 2 large 4k displays with DPI scaling set to 100%, and I have the real estate to be able to read things. On installs and at a regular club gig, I usually only have an HD display. On my laptop (an asus zenbook duo with a secondary built in display), 4K requires some scaling to be legible, so I’m usually at 150%.

I’ve seen reference to a UI overhaul being necessary for consistency, but the slug library seems to fix that, at least for TDs built in editors. The problem is, I often use custom popup UIs in windows comps, and if I set them up to be large enough to read at 4k 100%, they’re too huge on a 1920 display, or conversely too small in HD if they’re comfortable in 4k.

Are we still waiting on UI overhauls for consistent behavior, or does SLUG solve some of that problem? I’ve been thinking about doing something like building a global component wrapping a monitorsDAT, and setting the size of my popups to be a fraction of the monitors resolution, but in a scenario with mixed monitor sizes (one 4k, one HD), what is the best move? Should I use a mouseinCHOP and a monitorsDAT, and set resolution dynamically this way based on a fraction of the currently active screen size? Am I gonna get a big performance hit dynamically resizing UI elements when I call winopen()? If anyone has thoughts on a good solution I’m all ears

For UI based dialogs you should be using the Scaled units (leave DPI Scaling parameter to ‘Use DPI Scale’) to size your Window COMPs. Say it’s 400x300. Then you also size your panels within that space. Use the Text COMP so you always get properly rendered text. On a 100% scaled monitor that’ll open up at 400x300 pixels. On a 150% scaled monitor it’ll open up at 600x450 pixels. All of the logic works within 400x300 though, so you don’t have to think about the actual number of pixels the window and panels are taking up