Sprite:getWidth: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
'''Class:''' [[Sprite]]<br/>
=== <translate>Description</translate> ===
 
<translate><br />
=== Description ===
Returns the width of the sprite, in pixels. The width is calculated based on the<br />
Returns the width of the sprite in pixels. The width is calculated based on the bounds of the content of the sprite.
bounds of the content of the sprite.<br />
<syntaxhighlight lang="lua">
<br />
(number) = Sprite:getWidth(withoutTransform)
If the parameter "true" is passed, the original width is returned without transformations.</translate>
</syntaxhighlight>
<source lang="lua">
 
(any), (any) = Sprite:getWidth(withoutTransform)
 
</source>
If the parameter '''withoutTransform''' is set to true, the original width is returned without transformations.
=== <translate>Parameters</translate> ===
 
'''withoutTransform''': (boolean) <translate>If true, return the width of the Sprite without transformations else return the transformed width</translate> '''optional'''<br/>
=== Parameters ===
=== <translate>Return values</translate> ===
'''withoutTransform''': (boolean) if true, returns the width of the Sprite without transformations else returns the transformed width '''optional, default = false'''<br/>
'''<translate>Returns</translate>''' (any) <translate>Width of the sprite.</translate><br/>
 
'''<translate>Returns</translate>''' (any) <translate>Width of the sprite.</translate><br/>
=== Return values ===
'''Returns''' (number) the width of the sprite<br/>
 
{{Sprite}}

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