Hi guys!
I am a newbie.
I’ve got an sprite (elementos.png) and the elementos.lua file generated by Zwoptex.
--
--elementos.lua file
--
function getSpriteSheetData()
local sheet = {
frames = {
{
name = "barba.png",
spriteColorRect = { x = 0, y = 5, width = 40, height = 32 },
textureRect = { x = 2, y = 2, width = 40, height = 32 },
spriteSourceSize = { width = 40, height = 40 },
spriteTrimmed = true,
textureRotated = false
},
{
name = "boca.png",
spriteColorRect = { x = 3, y = 17, width = 34, height = 10 },
textureRect = { x = 38, y = 78, width = 34, height = 10 },
spriteSourceSize = { width = 40, height = 40 },
spriteTrimmed = true,
textureRotated = false
},
-- an so on..
}
}
return sheet
end
--
--main.lua
--
local datos=require("elementos")
local elementos = sprite.newSpriteSheetFromData( "elementos.png", datos.getSpriteSheetData() )
How can I access, for example, to the first image of the sprite?
Thanks in advance!
[import]uid: 44013 topic_id: 8269 reply_id: 308269[/import]