I have problems to understand the gideros class system (I have used java so far)...
I want to inherit a class from another class that is inherited from another class...
particle2D = Core.class(Sprite)
function particle2D:init(texRegion, ID)
self.ID = ID
blob = Core.class(Particle2D)
function blob:init(x, y, texRegion)
particle2D.init(self, texRegion, 1)
and then in main.lua
b = blob.new(someTexRegion, 10, 10)
but I get this error message:
buddi/Particle2D.lua:47: attempt to call method 'addChild' (a nil value)
buddi/Particle2D.lua:47: in function 'init'
buttons/SlotButton.lua:12: in function 'init'
[string "property.lua"]:52: in function '__new'
[string "property.lua"]:59: in function 'new'
main.lua:54: in main chunk
(where line 47 is the line with self:addChild(Bitmap.new(texRegion)) in Particle2D.lua)
however... when I create a particle2D object directly in main.lua then it works...
p = particle.new(someTexregion, 1)
somewhere here I read that init() is the constructor and I could call the super class with .init(self)...
but I think I'd need some better explanation on how classes in gideros work (and how I can create/inherite them)...
thanks for any help...
and how can I tag code as code in a post for better reading?