Difference between revisions of "Sprite:getWidth"

From GiderosMobile
(a little bit of update)
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Returns the width of the sprite in pixels. The width is calculated based on the bounds of the content of the sprite.
 
Returns the width of the sprite in pixels. The width is calculated based on the bounds of the content of the sprite.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(number) = Sprite:getWidth(withoutTransform)
 
(number) = Sprite:getWidth(withoutTransform)
 
</source>
 
</source>

Revision as of 15:31, 13 July 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. <syntaxhighlight lang="lua"> (number) = Sprite:getWidth(withoutTransform) </source>


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

Return values

Returns (number) the width of the sprite