Difference between revisions of "TextureRegion.new"

From GiderosMobile
(rearranged and removed language stuff)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Class:''' [[TextureRegion]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/TextureRegion|TextureRegion]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate><br />
+
Creates a new TextureRegion object.
Creates a new TextureRegion object.<br />
 
<br /></translate>
 
 
<source lang="lua">
 
<source lang="lua">
TextureRegion.new(texture)
+
TextureRegion.new(texture)
 +
</source>
 +
<source lang="lua">
 +
TextureRegion.new(texture,x,y,width,height)
 
</source>
 
</source>
=== <translate>Parameters</translate> ===
 
'''texture''': (TextureBase) <translate>texture object</translate> <br/>
 
__NOTOC__
 
<languages />
 
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
 
'''<translate>Class</translate>:''' [[Special:MyLanguage/TextureRegion|TextureRegion]]<br/>
 
=== <translate>Description</translate> ===
 
<translate><br />
 
Creates a new TextureRegion object.
 
  
 +
If TextureRegion object is created with 1 parameter (texture), it specifies the whole texture.
  
If TextureRegion object is created with 1 parameter (texture), it specifies the whole texture.<br />
+
If TextureRegion object is created with 5 parameters (texture, x, y, width, height), it specifies a rectangular region within texture.
If TextureRegion object is created with 5 parameters (texture, x, y, width, height), if specifies a rectangular region within texture.<br />
 
</translate>
 
  
 
+
=== Parameters ===
<source lang="lua">
+
'''texture''': (TextureBase) texture object<br/>
TextureRegion.new(texture,x,y,width,height)
+
'''x''': (number) left coordinate of the region<br/>
</source>
+
'''y''': (number) top coordinate of the region<br/>
=== <translate>Parameters</translate> ===
+
'''width''': (number) width of the region<br/>
'''texture''': (TextureBase) <translate>texture object</translate> <br/>
+
'''height''': (number) height of the region<br/>
'''x''': (number) <translate>left coordinate of the region</translate> <br/>
 
'''y''': (number) <translate>top coordinate of the region</translate> <br/>
 
'''width''': (number) <translate>width of the region</translate> <br/>
 
'''height''': (number) <translate>height of the region</translate> <br/>
 
  
 
{{TextureRegion}}
 
{{TextureRegion}}

Revision as of 22:07, 1 January 2022

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