Difference between revisions of "Sprite:getLayoutParameters"

From GiderosMobile
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2018.9<br/>
'''<translate>Available since</translate>:''' Gideros 2018.9<br/>
+
'''Class:''' [[Sprite]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate><br />
+
See '''[[Sprite:setLayoutParameters]]''' for a description of the fields.
<br />See [[Special:MyLanguage/Sprite:setLayoutParameters|Sprite:setLayoutParameters]] for a description of the fields.<br /></translate>
+
<syntaxhighlight lang="lua">
<source lang="lua">
+
(table) = Sprite:getLayoutParameters([mask,layoutKey])
(table) = Sprite:getLayoutParameters()
+
</syntaxhighlight>
</source>
+
 
=== <translate>Return values</translate> ===
+
=== Parameters ===
'''<translate>Returns</translate>''' (table) <translate>Table of layout parameters.</translate><br/>
+
'''mask''' (bool) enable masking '''optional'''<br/>
 +
'''layoutKey''' (LayoutKeys) the LayoutKeys to querry '''optional'''<br/>
 +
 
 +
=== Return values ===
 +
'''Returns''' (table) table of layout parameters<br/>
 +
 
 +
=== Example ===
 +
<syntaxhighlight lang="lua">
 +
-- Return a table containing only the computed cellSpacingY of the layout, instead of returning everything
 +
local lp = sprite:getLayoutParameters(true, Sprite.LayoutKeys.cellSpacingY)
 +
print(lp.cellSpacingY[1], lp.cellSpacingY[2], lp.cellSpacingY[3]) -- three columns grid
 +
</syntaxhighlight>
 +
 
 +
{{Sprite}}

Latest revision as of 14:56, 20 October 2025

Available since: Gideros 2018.9
Class: Sprite

Description

See Sprite:setLayoutParameters for a description of the fields.

(table) = Sprite:getLayoutParameters([mask,layoutKey])

Parameters

mask (bool) enable masking optional
layoutKey (LayoutKeys) the LayoutKeys to querry optional

Return values

Returns (table) table of layout parameters

Example

-- Return a table containing only the computed cellSpacingY of the layout, instead of returning everything
local lp = sprite:getLayoutParameters(true, Sprite.LayoutKeys.cellSpacingY)
print(lp.cellSpacingY[1], lp.cellSpacingY[2], lp.cellSpacingY[3]) -- three columns grid