Difference between revisions of "Sprite:setClip"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2015.04.04<br/>
 
'''Available since:''' Gideros 2015.04.04<br/>
 +
'''Class:''' [[Sprite]]<br/>
 +
 
=== Description ===
 
=== Description ===
Clip Sprite contents from provided x, y position to provided width and height
+
Clips Sprite content from provided x, y position to provided width and height.
 +
<syntaxhighlight lang="lua">
 +
Sprite:setClip(x,y,width,height)
 +
</syntaxhighlight>
 +
 
 +
Setting width or height to -1 will disable clipping.
  
Setting width or height to -1 will disable it
 
<source lang="lua">
 
Sprite:setClip(x,y,width,height)
 
</source>
 
 
=== Parameters ===
 
=== Parameters ===
'''x''': (number) x position from where to clip <br/>
+
'''x''': (number) x position from where to clip<br/>
'''y''': (number) y position from where to clip <br/>
+
'''y''': (number) y position from where to clip<br/>
'''width''': (number) width of how much to display before clipping <br/>
+
'''width''': (number) width of how much to display before clipping<br/>
'''height''': (number) width of how much to display before clipping <br/>
+
'''height''': (number) width of how much to display before clipping<br/>
 +
 
 +
{{Sprite}}

Latest revision as of 14:33, 13 July 2023

Available since: Gideros 2015.04.04
Class: Sprite

Description

Clips Sprite content from provided x, y position to provided width and height.

Sprite:setClip(x,y,width,height)

Setting width or height to -1 will disable clipping.

Parameters

x: (number) x position from where to clip
y: (number) y position from where to clip
width: (number) width of how much to display before clipping
height: (number) width of how much to display before clipping