Hi, I'm trying to use TiledAsWorldEditor, and I've been able to draw a scene and physics objects, but how do I use onEnterFrame?
The level is created with
Level = TiledAsWorldEditor.new("level.lua")
self:addChild(Level)
which works fine.
Now, if I try something like this:
Level.B2_Worlds[1]:addEventListener(Event.ENTER_FRAME, onEnterFrame)
function onEnterFrame()
print("Test")
end
it doesn't do anything (I use the print to determine whether the onEnterFrame is working or not.
Does anyone know how to do this right?
-------------------------------------------------
Edit: I got it working, it was simpler than I thought. I just needed to use
self:addEventListener(Event.ENTER_FRAME, self.onEnterFrame, self)
and
function gamescene:onEnterFrame()