TextureRegion.new: Difference between revisions

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..."
 
No edit summary
Line 6: Line 6:
<br />
<br />
<source lang="lua">
<source lang="lua">
= TextureRegion.new(texture,)
TextureRegion.new(texture)
</source>
</source>
'''texture:''' (TextureBase) texture object ''''''<br/>
'''texture''': (TextureBase) texture object ''''''<br/>
__NOTOC__
__NOTOC__
'''Available since:''' Gideros 2011.6<br/>
'''Available since:''' Gideros 2011.6<br/>
Line 21: Line 21:
<br />
<br />
<source lang="lua">
<source lang="lua">
= TextureRegion.new(texturexywidthheight,)
TextureRegion.new(texture,x,y,width,height)
</source>
</source>
'''texture:''' (TextureBase) texture object ''''''<br/>
'''texture''': (TextureBase) texture object ''''''<br/>
'''x:''' (number) left coordinate of the region ''''''<br/>
'''x''': (number) left coordinate of the region ''''''<br/>
'''y:''' (number) top coordinate of the region ''''''<br/>
'''y''': (number) top coordinate of the region ''''''<br/>
'''width:''' (number) width of the region ''''''<br/>
'''width''': (number) width of the region ''''''<br/>
'''height:''' (number) height of the region ''''''<br/>
'''height''': (number) height of the region ''''''<br/>

Revision as of 09:17, 23 August 2018

Available since: Gideros 2011.6

Description


Creates a new TextureRegion object.

 TextureRegion.new(texture)

'texture: (TextureBase) texture object '

Available since: Gideros 2011.6

Description


Creates a new TextureRegion object.

<ul>
<li>If TextureRegion object is created with 1 parameter (texture), it specifies the whole texture.</li>
<li>If TextureRegion object is created with 5 parameters (texture, x, y, width, height), if specifies a rectangular region within texture.</li>
</ul>

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

'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 '