[0.17.41][API request] LuaGuiElement.add allow specifying direction for scroll-pane
Posted: Tue May 21, 2019 4:11 pm
Hi,
I have 5 different UI's that I want to show an overview, but it could be quite long (for example configuration of the ForceField walls, a section could easly exist out of 50-ish walls, so 50 buttons next to each other). To make sure this is easy accessable in the UI, I create a scroll-pane and add a horizontal flow inside. This is how I've done it in 0.16 - where I learned creating GUIs. With the 0.17 debug options I learned alot from GUIs, and hence my request:
My request is to expose the flow direction to the API just like is done with the frame, where we can define the direction of it:
lovely_santa
I have 5 different UI's that I want to show an overview, but it could be quite long (for example configuration of the ForceField walls, a section could easly exist out of 50-ish walls, so 50 buttons next to each other). To make sure this is easy accessable in the UI, I create a scroll-pane and add a horizontal flow inside. This is how I've done it in 0.16 - where I learned creating GUIs. With the 0.17 debug options I learned alot from GUIs, and hence my request:
- If I create a flow, I can define if it needs to stack its children horizontaly or verticaly.
- If I create a frame, the game engine creates the actual visible frame, with a hidden flow inside. The API allows me to define the direction of the hidden flow in the creation of the frame.
- If I create a scroll-pane, the API states:
which the game engine creates a hidden vertical flow that can scroll, as shown in the picture. To add my horizontal buttons I have to add a horizontal flow inside instead.Factorio API wrote:Similar to a flow but includes the ability to show and use scroll bars.

Kind regards,New Factorio API wrote:
- Other attributes may have to be specified, depending on type
- scroll-pane
- direction :: string: The initial direction of the scroll-pane's layout. See LuaGuiElement::direction.
- horizontal_scroll_policy :: string (optional): Policy of the horizontal scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
- vertical_scroll_policy :: string (optional): Policy of the vertical scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
lovely_santa