UMG Scale Box Empty Space

Hello,
I have inventory which is generated dynamically with given amount of slots and amount of columns.
Everything works fine, but I want to have my slots to be always square. To do that I’ve used scale box and size box which is set to 200 X and 200 Y size. It looks like this:

The problem is that after scaling it in scale box it leaves space to keep it square, and becouse of that I can’t have each row of inventory directly one after another. It looks like this:

100470-inventoryscalingproblem.png

What can I do to wrap this space? Thanks in advance :wink:

Hello,

Check the tiling settings on your image. What do you have this set to?

Hello,
Thanks for the reply. I have image tilling set to “No Tile”, but even when I remove that Image I still have the gap. It looks like this when I manually add slots in the editor:

There could be a number of settings that are affecting the display of your inventory slots. Could you zip up the project, upload it to Dropbox, and provide me with a link so that we can take a closer look at your setup?

You can PM me the link on the forums: https://forums.unrealengine.com/member.php?160394-Sean-Flint

After investigating the project, setting the Size Box’s alignment settings to Fill resolved the gaps that you were experiencing.

Let me know if that helps.

Have a great day

Hello, Thanks for the reply. While it solves the problem of the gap it still makes another problem that slots in that setting are no longer square. Depending on screen size it becomes more or less rectangular. I need them to be square all the time. Is there a way to keep them square like before and remove the gap?
Here’s the example:

100679-wideslots.png

After looking into it further, either the scroll box has to maintain a certain aspect ratio, or you’re going to see stretching and/or gaps. This is because the desired shape of your Inventory Slot is a perfect square. When your scroll box changes size, it is no longer perfectly divisible by the total size of all of the slots combined.

Eventually I’ve decided to set Size Box to fill, and manually set square size for given amount of slots per row, so it’s almost square. Thanks for the help, and the question can be marked as solved, or tell me how to mark it since I’m new here :smiley:

Glad to hear it. For future reference, you can mark a post resolved by clicking the check box to the left of an answer, underneath the upvote buttons.