Difference between revisions of "Sprite:setClip"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2015.04.04<br/> === Description === Clip Sprite contents from provided x, y position to provided width and height Setting width or he...")
 
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(9 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.
 +
 
 +
=== Parameters ===
 +
'''x''': (number) x 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/>
 +
'''height''': (number) width of how much to display before clipping<br/>
  
Setting width or height to -1 will disable it
+
{{Sprite}}
<source lang="lua">
 
= Sprite:setClip(xywidthheight,)
 
</source>
 
'''x:''' (number) x 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/>
 
'''height:''' (number) width of how much to display before clipping ''''''<br/>
 

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