Difference between revisions of "Sprite:getWidth"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Returns the width of the sprite, in pixels. The width is calculated based on the<br /> bounds o...")
 
 
(10 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 ===
<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.
+
 
<source lang="lua">
+
 
(any) (any), = Sprite:getWidth(withoutTransform,)
+
If the parameter '''withoutTransform''' is set to true, the original width is returned without transformations.
</source>
+
 
'''withoutTransform:''' (boolean) If true, return the width of the Sprite without transformations else return the transformed width '''optional'''<br/>
+
=== Parameters ===
'''Returns''' (any) Width of the sprite.<br/>
+
'''withoutTransform''': (boolean) if true, returns the width of the Sprite without transformations else returns the transformed width '''optional, default = false'''<br/>
'''Returns''' (any) Width of the sprite.<br/>
+
 
 +
=== Return values ===
 +
'''Returns''' (number) the width of the sprite<br/>
 +
 
 +
{{Sprite}}

Latest revision as of 20: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