0 votes

I'm making an inventory system and I have a scroll container within an hbox container. The problem is caused by the scroll bar, which is directly next to the buttons. I want to create a margin so the scroll bar doesn't touch the buttons, but every time I resize the rect the HboxContainer prevents the resize. I have no clue why it does this as making the container 2 pixels wider doesn't affect the horizontal sorting at all. Any clue on how to circumvent this issue?

Scroll Container in engine:
Scroll container in engine
Scroll container in game:
Scroll container in game

asked Jun 8 in Engine by DigitalDrako (108 points)

1 Answer

+1 vote

I think you are actually using a VBoxContainer right, since your buttons are stacked vertically.

One way to solve your issue is to place the Vbox or Hbox container inside a MarginContainer, and set the CustomConstants to the margins you want. Your tree would look something like this:

answered Jun 9 by Saitodepaula (119 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.