Difference between revisions of "TextureRegion.new"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Creates a new TextureRegion object.<br /> <br /> <source lang="lua"> = TextureRegion.new(textur...")
 
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
'''Class:''' [[TextureRegion]]<br/>
 +
 
=== Description ===
 
=== Description ===
<br />
+
Creates a new TextureRegion object.
Creates a new TextureRegion object.<br />
+
<syntaxhighlight lang="lua">
<br />
+
TextureRegion.new(texture)
<source lang="lua">
+
</syntaxhighlight>
= TextureRegion.new(texture,)
+
<syntaxhighlight lang="lua">
</source>
+
TextureRegion.new(texture,x,y,width,height)
'''texture:''' (TextureBase) texture object ''''''<br/>
+
</syntaxhighlight>
__NOTOC__
+
 
'''Available since:''' Gideros 2011.6<br/>
+
If TextureRegion object is created with 1 parameter (texture), it specifies the whole texture.
=== Description ===
+
 
<br />
+
If TextureRegion object is created with 5 parameters (texture, x, y, width, height), it specifies a rectangular region within texture.
Creates a new TextureRegion object.<br />
+
 
<br />
+
=== Parameters ===
&lt;ul&gt;<br />
+
'''texture''': (TextureBase) texture object<br/>
&lt;li&gt;If TextureRegion object is created with 1 parameter (texture), it specifies the whole texture.&lt;/li&gt;<br />
+
'''x''': (number) left coordinate of the region<br/>
&lt;li&gt;If TextureRegion object is created with 5 parameters (texture, x, y, width, height), if specifies a rectangular region within texture.&lt;/li&gt;<br />
+
'''y''': (number) top coordinate of the region<br/>
&lt;/ul&gt;<br />
+
'''width''': (number) width of the region<br/>
<br />
+
'''height''': (number) height of the region<br/>
<source lang="lua">
+
 
= TextureRegion.new(texturexywidthheight,)
+
{{TextureRegion}}
</source>
 
'''texture:''' (TextureBase) texture object ''''''<br/>
 
'''x:''' (number) left coordinate of the region ''''''<br/>
 
'''y:''' (number) top coordinate of the region ''''''<br/>
 
'''width:''' (number) width of the region ''''''<br/>
 
'''height:''' (number) height of the region ''''''<br/>
 

Latest revision as of 15:33, 13 July 2023

Available since: Gideros 2011.6
Class: TextureRegion

Description

Creates a new TextureRegion object.

TextureRegion.new(texture)
TextureRegion.new(texture,x,y,width,height)

If TextureRegion object is created with 1 parameter (texture), it specifies the whole texture.

If TextureRegion object is created with 5 parameters (texture, x, y, width, height), it specifies a rectangular region within texture.

Parameters

texture: (TextureBase) texture object
x: (number) left coordinate of the region
y: (number) top coordinate of the region
width: (number) width of the region
height: (number) height of the region