Search code examples
user-interfaceradio-buttongame-enginegodotgdscript

Godot OptionButton limit size of item list


I am working on the GUI of my game right now and I have a question towards the OptionButton. When there are a lot of items in the OptionButton, the item list will start somewhere else in the screen and will go to the end of the screen which just looks awful. (picture 1). I would like to limit the size of the Item list and let it start where it normaly should start (picture 2). Also I would like to have a scrolling functionality in it after limiting the height of the item list (if it is not already the case after limiting the size). Does anyone know how to do this?

1: https://i.sstatic.net/7XbON.png 2: https://i.sstatic.net/4LQs7.png

Thanks in advance, Orchi


Solution

  • You should be able to accomplish that by putting your options inside a ScrollContainer.

    Here is the Documentation