Difference between revisions of "TextureRegion.new"

From GiderosMobile
(rearranged and removed language stuff)
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Creates a new TextureRegion object.
 
Creates a new TextureRegion object.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
TextureRegion.new(texture)
 
TextureRegion.new(texture)
 
</source>
 
</source>
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
TextureRegion.new(texture,x,y,width,height)
 
TextureRegion.new(texture,x,y,width,height)
 
</source>
 
</source>

Revision as of 14:31, 13 July 2023

Available since: Gideros 2011.6
Class: TextureRegion

Description

Creates a new TextureRegion object. <syntaxhighlight lang="lua"> TextureRegion.new(texture) </source> <syntaxhighlight lang="lua"> TextureRegion.new(texture,x,y,width,height) </source>

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