ButtonRowLayout
Package: Libraries.Interface.Layouts · Inherits from: Libraries.Language.Object, Libraries.Interface.Layouts.Layout
The ButtonRowLayout puts a row of buttons side by side, each as wide as its words, when they all fit in the container's width. When they don't, every button goes on its own line instead, as wide as the container, so a row is never broken partway. The container is as tall as what it holds. Items that aren't showing are skipped.
Example Code
use Libraries.Game.Game
use Libraries.Interface.Controls.Control
use Libraries.Interface.Controls.Button
use Libraries.Interface.Layouts.ButtonRowLayout
class Main is Game
action Main
StartGame()
end
action CreateGame
Control row
ButtonRowLayout layout
row:SetLayout(layout)
row:SetPercentageWidth(1.0)
row:SetVerticalLayoutMode(row:FIT_CONTENTS)
Button choose
choose:SetName("Choose...")
row:Add(choose)
Button remove
remove:SetName("Remove")
row:Add(remove)
Add(row)
end
end
Actions
GetGap()
This action returns the space between the buttons, in points before the interface scale.
Returns
number: The space between the buttons
Layout(Libraries.Interface.Controls.Control container, Libraries.Containers.Array<Libraries.Interface.Item2D> items, number containerWidth, number containerHeight)
This action returns the space between the buttons, in points before the interface scale.
Parameters
containerLibraries.Interface.Controls.ControlitemsLibraries.Containers.Array<Libraries.Interface.Item2D>containerWidthnumbercontainerHeightnumber
SetGap(number value)
This action sets the space between the buttons, in points before the interface scale. The default is 8.
Parameters
valuenumber: The space between the buttons