Difference between revisions of "Sprite:getWidth"

From GiderosMobile
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[Sprite]]<br/>
 +
 
=== Description ===
 
=== Description ===
<translate><br />
+
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<br />
+
<syntaxhighlight lang="lua">
bounds of the content of the sprite.<br />
+
(number) = Sprite:getWidth(withoutTransform)
<br />
+
</syntaxhighlight>
If the parameter "true" is passed, the original width is returned without transformations.</translate>
+
 
<source lang="lua">
+
 
(any), (any) = Sprite:getWidth(withoutTransform)
+
If the parameter '''withoutTransform''' is set to true, the original width is returned without transformations.
</source>
+
 
 
=== Parameters ===
 
=== Parameters ===
'''withoutTransform''': (boolean) <translate>If true, return the width of the Sprite without transformations else return the transformed width</translate> '''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 ===
'''Returns''' (any) <translate>Width of the sprite.</translate><br/>
+
'''Returns''' (number) the width of the sprite<br/>
'''Returns''' (any) <translate>Width of the sprite.</translate><br/>
+
 
 +
{{Sprite}}

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