Difference between revisions of "TextureRegion.new"
From GiderosMobile
Line 20: | Line 20: | ||
Creates a new TextureRegion object.<br /> | Creates a new TextureRegion object.<br /> | ||
<br /> | <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 /> | |
− | + | <br /> | |
− | |||
<br /></translate> | <br /></translate> | ||
<source lang="lua"> | <source lang="lua"> |
Revision as of 15:23, 26 June 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