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

in Engine by (206 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:

by (128 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.