Difference between revisions of "TexturePack:getTextureRegion"

From GiderosMobile
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Available since:''' Gideros 2011.6<br/>
+
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
=== Description ===
+
=== <translate>Description</translate> ===
 
<translate><br />
 
<translate><br />
 
Returns the texture region of texture pack.<br />
 
Returns the texture region of texture pack.<br />
Line 8: Line 8:
 
(TextureRegion) = TexturePack:getTextureRegion(texturename)
 
(TextureRegion) = TexturePack:getTextureRegion(texturename)
 
</source>
 
</source>
=== Parameters ===
+
=== <translate>Parameters</translate> ===
 
'''texturename''': (string) <translate></translate> <br/>
 
'''texturename''': (string) <translate></translate> <br/>
=== Return values ===
+
=== <translate>Return values</translate> ===
'''Returns''' (TextureRegion) <translate>TextureRegion by specified name</translate><br/>
+
'''<translate>Returns</translate>''' (TextureRegion) <translate>TextureRegion by specified name</translate><br/>
=== Examples ===
+
=== <translate>Examples</translate> ===
 
'''Example'''<br/>
 
'''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;})
 
<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;})

Revision as of 07:28, 24 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;})

local region1 = pack:getTextureRegion(&quot;gfx/1.png&quot;)
local region2 = pack:getTextureRegion(&quot;gfx/2.png&quot;)
local region3 = pack:getTextureRegion(&quot;gfx/3.png&quot;)
local region4 = pack:getTextureRegion(&quot;gfx/4.png&quot;)