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
You can highlight the code by putting the code between < pre lang="lua" > and < /pre > (without spaces).
Here you should call Sprite.new (not Sprite:new) and you should create a Bitmap instead of Sprite:
hope this helps
Likes: plamen
Likes: Radiesel, SinisterSoft
Maybe one of us will release world saving app made with Gideros, but now he or she could not do it, because it misses, I don't know (render to texture, antialising, font cache, etc) pick one
And by the way @atilim, it seems that you are a (someone who belief that app world is divided into distinct large groups called app stores and that certain apps share certain stores which make that group of apps as a whole less desirable, more desirable, inferior or superior) so you are an appist (appstorist ? )!
Because the idea that the world saving app might get released on Android market didn't even crossed your mind
I hope that @lumendes will not be shocked, but in this forum, things usually go off topic. And then when someone tries to go back to topic, all other users start to think that this someone is actually off topic.
But don't you worry about that, main concern is that your problem should have been solved
Likes: gorkem
I should get into Lua, knowing Python is not enough.
Eh eh, I can also see that things here can escalate quite fast offtopic
BTW, if movies have taught anything, it is that all natural disasters, aliens, etc happen only in the USA...
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
Likes: OZApps
Ultimately it is upto you as the developer on how much do you need to learn and how will it help you.
But yes, Learning Lua is a very good career move... it is one of the better languages to learn and develop with or integrate into your C/C#/C++ code. Where Python is strict on whitespace and alignment (reminds me of RPG / Cobol) Lua is forgiving and flexible.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
With this feature we could create a clipping rectangle and put the earth outside so whatever is supposed to happen won't be able to see the Earth is so can't happen.
Also if the Earth is outside the clipping area we won't be able to see what's happening either so there is nothing for us to worry about. )
WIN, WIN situation so we need GLScissor as soon as possible. We can then write an Android app and use it to save everyone (even the iOS people).
That is what you call thinking OUTSIDE THE BOX )
Likes: ar2rsawseen
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
But about ninjajing, I've got a new strategy. Post a blank response first, modify it to a clear answer later, that way you can't be ninjajed
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
The fact that Siri tells you it can't find an event is the time to worry that the event is imminent
Don't forget Google tried to remove the month of December to stop the inevitable. If December doesn't exist then the 21st cannot actually happen.
Simples )
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps