Difference between revisions of "Sprite:getWidth"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
(number) = Sprite:getWidth(withoutTransform)
 
(number) = Sprite:getWidth(withoutTransform)
</source>
+
</syntaxhighlight>
  
  
Line 13: Line 13:
  
 
=== Parameters ===
 
=== Parameters ===
'''withoutTransform''': (boolean) if true, returns the width of the Sprite without transformations else returns the transformed width '''optional'''<br/>
+
'''withoutTransform''': (boolean) if true, returns the width of the Sprite without transformations else returns the transformed width '''optional, default = false'''<br/>
  
 
=== Return values ===
 
=== Return values ===

Latest revision as of 19:31, 22 November 2023

Available since: Gideros 2011.6
Class: Sprite

Description

Returns the width of the sprite in pixels. The width is calculated based on the bounds of the content of the sprite.

(number) = Sprite:getWidth(withoutTransform)


If the parameter withoutTransform is set to true, the original width is returned without transformations.

Parameters

withoutTransform: (boolean) if true, returns the width of the Sprite without transformations else returns the transformed width optional, default = false

Return values

Returns (number) the width of the sprite