Dynamic Resizing of Widgets That Are Not Effected By DPI Scale

anonymous_user_a0164839
Sat, 19 Feb 2022 14:59:37 +0000
UI

Hi everyone. I’ve been stuck on this issue for months now and have exhausted pretty much all resources that I can find online about the topic.

I’m trying to create widgets for my game that can be dynamically resized, the same as a Window on a desktop. I have installed a plugin that allows me to create these windows and they can be resized within the canvas when playing but I find that the widget elements such as images and text inside of these windows are being resized automatically based on the DPI scale.

So for example here I have placed an image in the centre of the Canvas:

And when I resize the preview scale the image resizes to a smaller size automatically:

The same will happen when I make the screen larger, the image is made bigger automatically:

Ideally, I would like to be able to control the sizes that the DPI scale seems to be setting the image to automatically. I want to be able to set a minimum and maximum width and height of the element and then when I change the DPI scale the image would go no smaller than the minimum size and no bigger than the max. I’ve tried using Size boxes and Scale Boxes and combinations of the two but I just cannot seem to find the correct settings I need to achieve this. The closest I have got is using scale boxes and setting them so that the image cannot be resized at all.

If anyone has a solution for this that could be explained clearly (preferably with screenshots) I would really appreciate it as I’ve found similar questions asked online before but usually the answers are quite vague and do not show the exact settings needed. Thanks for your time!

1 post - 1 participant