Difference between revisions of "TexturePack:getTextureRegion"

From GiderosMobile
Line 8: Line 8:
 
(TextureRegion) = TexturePack:getTextureRegion(texturename)
 
(TextureRegion) = TexturePack:getTextureRegion(texturename)
 
</source>
 
</source>
'''texturename''': (string)  ''''''<br/>
+
=== Parameters ===
 +
'''texturename''': (string)  <br/>
 +
=== Return values ===
 
'''Returns''' (TextureRegion) TextureRegion by specified name<br/>
 
'''Returns''' (TextureRegion) TextureRegion by specified name<br/>
 +
=== Examples ===
 +
'''Example'''<br/>
 +
<source lang="lua">local pack = TexturePack.new({&quot;gfx/1.png&quot;, &quot;gfx/2.png&quot;, &quot;gfx/3.png&quot;, &quot;gfx/4.png&quot;})<br />
 +
<br />
 +
local region1 = pack:getTextureRegion(&quot;gfx/1.png&quot;)<br />
 +
local region2 = pack:getTextureRegion(&quot;gfx/2.png&quot;)<br />
 +
local region3 = pack:getTextureRegion(&quot;gfx/3.png&quot;)<br />
 +
local region4 = pack:getTextureRegion(&quot;gfx/4.png&quot;)<br /></source>

Revision as of 10:45, 23 August 2018

Available since: Gideros 2011.6

Description


Returns the texture region of texture pack.

(TextureRegion) = TexturePack:getTextureRegion(texturename)

Parameters

texturename: (string)

Return values

Returns (TextureRegion) TextureRegion by specified name

Examples

Example

local pack = TexturePack.new({&quot;gfx/1.png&quot;, &quot;gfx/2.png&quot;, &quot;gfx/3.png&quot;, &quot;gfx/4.png&quot;})<br />
<br />
local region1 = pack:getTextureRegion(&quot;gfx/1.png&quot;)<br />
local region2 = pack:getTextureRegion(&quot;gfx/2.png&quot;)<br />
local region3 = pack:getTextureRegion(&quot;gfx/3.png&quot;)<br />
local region4 = pack:getTextureRegion(&quot;gfx/4.png&quot;)<br />