A ColLayout
is a layout that represents a single row of elements (a set
of multiple columns). Each column has the same size and can contain one
element only. If another element is added to the same column, the column's
current element is removed from the layout.
Constructor
new(posX:Int, posY:Int, width:Int, height:Int, amountCols:Int)
Creates a new column layout.
Parameters:
posX | The x position of the layout |
---|---|
posY | The y position of the layout |
width | The width of the layout |
height | The height of the layout |
amountCols | The amount of columns |
Methods
addToColumn(element:Element, column:Int, ?anchor:Anchor):Void
Adds an element to this ColLayout
at the given position. Please note
that if an element already exists at that position, it is removed from
the layout.
If the given position does not exist, an error is raised and the element is not added to this layout.
Parameters:
element | The given element |
---|---|
column | The column this element should be placed in |
anchor | (Optional) The anchor of the element. If not given, use the elements default anchor. Otherwise, the element's anchor setting is overwritten. |
removeAtColumn(column:Int):Void
Removes the element at the given column from this layout.
Parameters:
column | The column of the element |
---|