Difference between revisions of "TextureRegion.new"

 
(2 intermediate revisions by one other user not shown)
Line 19: Line 19:
 
<translate><br />
 
<translate><br />
 
Creates a new TextureRegion object.
 
Creates a new TextureRegion object.
 +
  
 
If TextureRegion object is created with 1 parameter (texture), it specifies the whole texture.<br />
 
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), if specifies a rectangular region within texture.<br />
 
If TextureRegion object is created with 5 parameters (texture, x, y, width, height), if specifies a rectangular region within texture.<br />
 +
</translate>
 +
  
</translate>
 
 
<source lang="lua">
 
<source lang="lua">
TextureRegion.new(texture,x,y,width,height)
+
TextureRegion.new(texture,x,y,width,height)
 
</source>
 
</source>
 
=== <translate>Parameters</translate> ===
 
=== <translate>Parameters</translate> ===
Line 33: Line 35:
 
'''width''': (number) <translate>width of the region</translate> <br/>
 
'''width''': (number) <translate>width of the region</translate> <br/>
 
'''height''': (number) <translate>height of the region</translate> <br/>
 
'''height''': (number) <translate>height of the region</translate> <br/>
 +
 +
{{TextureRegion}}

Latest revision as of 03:19, 4 December 2019


Available since: Gideros 2011.6
Class: TextureRegion

Description


Creates a new TextureRegion object.

 TextureRegion.new(texture)

Parameters

texture: (TextureBase) texture object


Available since: Gideros 2011.6
Class: TextureRegion

Description


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 5 parameters (texture, x, y, width, height), if specifies a rectangular region within texture.


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

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