so far I tried out the suggestion from Philho to extend the Physics class and overide the defaultDraw method, but doesn't work in any case.
so heres the code:
Code:
class Jbox < Processing::App
#load and include java library stuff...
def setup
@p = Physics.new(self,width,height)
@p.createrect(3,3,5,5)
end
def draw
end
end
this works like a charm. now here's where I'm failing:
Code:
def setup
@p.setCustomRenderingMethod( self, 'custom_rendering')
end
def custom_rendering(world)
end
this is chrashing with mentioned error..
Mixin with module "Physics":
Code:
module Physics
end
class Jbox2d ...
def setup
@p = Physics.new(self,width,height)
.
.
this is enough to break the whole thing, even tough i still didn't done @p.extend(Physics). I get the error that new isn't defined, which i was not intended to override...it seems like ruby prefere to take the local definitions then the java ones.But why?!
then i tried this:
Code:
class Jbox2d ...
...
def defaultDraw(world)
...stuff.
end
..
end
does not work too, it doesn't run in that mehtod..
so these are my attempts, I'm out of ideas..can somebody help?