Sprite:getLayoutInfo

From GiderosMobile
Revision as of 16:25, 20 October 2025 by MoKaLux (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2018.9
Class: Sprite

Description

Returns computed placement value according to Gideros layout system.

(table) = Sprite:getLayoutInfo()

The returned table can contain the following fields:

  • startx (number): the 0-based index of the column the child was placed into
  • starty (number): the 0-based index of the row the child was placed into
  • width (number): the width of the child (number of columns)
  • height (number): the height of the child (number of rows)
  • weightX (table): the horizontal weight of the child
  • weightY (table): the vertical weight of the child
  • minWidth (table): minimum width
  • minHeight (table): minimum height
  • reqWidth (number): total grid width in pixels
  • reqHeight (number): total grid height in pixels
  • cellSpacingX (number): cell spacing x
  • cellSpacingY (number): cell spacing y

Return values

Returns (table) table of layout information

Example

local lp3 = myholder:getLayoutInfo()
for k, v in pairs(lp3) do
	print(k, v)
end
print(lp3.width)