A board (fl_tile_board) that lays its child panels out on a grid of equally sized cells. Set the number of columns and rows with set_grid_size, then dock panels with attach_panel, which positions and sizes them from the size the board has at that moment. Derives from fl_base_panel.

Summary

Methods

Parents a panel to the board and docks it at a grid position.
Returns the size of the grid, either as a whole or for a single dimension.
Init()client
Gives the board a grid of one cell and an empty list of docked panels of its own.
Moves and resizes a docked panel according to its grid position and the current size of the board.
Fills in the missing grid coordinates of a docked entry and repositions its panel.
Sets the number of columns and rows of the grid.
Think()client
Twice a second, drops docked entries whose panel is no longer valid.

Methods

PANEL:attach_panel(panel, x, y, w, h)

client packages/active_ui/views/base/cl_tileboard.lua:106

Parents a panel to the board and docks it at a grid position.

Parameters

  • panel Panel
  • x Number optional, defaults to 1 horizontal grid position
  • y Number optional, defaults to 1 vertical grid position
  • w Number optional, defaults to 1 width in grid cells
  • h Number optional, defaults to 1 height in grid cells

Returns

  • Map the docked entry { panel = Panel, pos = { x, y, w, h } }, or nil if it could not be positioned

PANEL:get_grid_size(dimension)

client packages/active_ui/views/base/cl_tileboard.lua:47

Returns the size of the grid, either as a whole or for a single dimension.

Parameters

  • dimension Boolean optional, defaults to nil true for the number of columns, false for rows, nil for both

Returns

  • Number/Map the requested dimension, or the { x = columns, y = rows } table

Gives the board a grid of one cell and an empty list of docked panels of its own.

PANEL:position_panel(obj)

client packages/active_ui/views/base/cl_tileboard.lua:63

Moves and resizes a docked panel according to its grid position and the current size of the board.

Parameters

  • obj Map docked entry of the form { panel = Panel, pos = { x, y, w, h } }

Returns

  • Map the same entry, or nil if its panel is invalid or the grid size is not positive

PANEL:set_docked_pos(panel, x, y, w, h)

client packages/active_ui/views/base/cl_tileboard.lua:89

Fills in the missing grid coordinates of a docked entry and repositions its panel. Coordinates the entry already has are kept; only those that are nil take the given values.

Parameters

  • panel Map docked entry as returned by attach_panel, not the panel itself
  • x Number horizontal grid position
  • y Number vertical grid position
  • w Number width in grid cells
  • h Number height in grid cells

Returns

  • Map the entry, or nil if it could not be positioned

PANEL:set_grid_size(x, y)

client packages/active_ui/views/base/cl_tileboard.lua:33

Sets the number of columns and rows of the grid. Does nothing if x is not a number.

Parameters

  • x Number columns
  • y Number optional, defaults to x rows

Twice a second, drops docked entries whose panel is no longer valid.

Defined in