Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
How to use onEnterFrame with Tiled level? — Gideros Forum

How to use onEnterFrame with Tiled level?

KarrizKarriz Member
edited July 2013 in General questions
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()

Likes: talis

+1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.