TexturePack:getTextureRegion

From GiderosMobile
Revision as of 14:31, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "<source" to "<syntaxhighlight")

Available since: Gideros 2011.6
Class: TexturePack

Description

Returns the texture region for the given texture name. <syntaxhighlight lang="lua"> (TextureRegion) = TexturePack:getTextureRegion(texturename) </source>

Parameters

texturename: (string) packed texture path

Return values

Returns (TextureRegion) TextureRegion by specified name

Example

<syntaxhighlight lang="lua"> local pack = TexturePack.new({"gfx/1.png", "gfx/2.png", "gfx/3.png", "gfx/4.png"})

local region1 = pack:getTextureRegion("gfx/1.png") local region2 = pack:getTextureRegion("gfx/2.png") local region3 = pack:getTextureRegion("gfx/3.png") local region4 = pack:getTextureRegion("gfx/4.png") </source>