Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
TexturePack issues — Gideros Forum

TexturePack issues

lumendeslumendes Member
edited December 2012 in Bugs and issues
Hello all,

I'm new around here, and like most of you I'm a indie game enthusiast :)
Currently I'm experimenting with gideros mobile, and so far it looks great, the kind of tool I've been looking in order to speed up game development and reduce coding complexity :)
I'm new to Lua, but experienced somehow in Python, Java and c++ (far from guru though).

Just faced a problem while playing with TexturePack, I expected TexturePack:getTextureRegion to return a TextureRegion, but somehow I'm getting a table instead... being scratching my head around and found to solution yet.

Most likely... a Lua beginner usual problem, but anyway here's the template code:
SceneMainMenu = Core.class(Sprite)
 
-- init
function SceneMainMenu:init(t)
 
	(...)	
 
	-- load spritesheet textures
	self.sheetMenu = TexturePack.new("images/main_menu.txt", "images/main_menu.png", true)
 
	(...)
end
 
-- draw scene menu
function SceneMainMenu:drawMenu()
 
	(...)
 
        local ball = Sprite:new(self.sheetMenu:getTextureRegion("ballred.png"))
 
        error here --> calling 'new' on bad self (TextureBase or TextureRegion expected, got table)
 
	(...)
 
end
Anyone available to point out the problem ?

By the way, how to use code syntax highlight or any other kind of formatting here on the forum ?

Cheers

Comments

Sign In or Register to comment.