Table of Contents

TexturePack:getTextureRegion

Available since version: Gideros 2011.6

Description:

Returns the texture region of texture pack.

Syntax:

(TextureRegion) = TexturePack:getTextureRegion(texturename)

Parameters:

  • texturename: (string)

Return value:

  • TextureRegion: TextureRegion by specified name

Examples:

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")