调用eventListener的对象

时间:2013-07-04 13:41:42

标签: lua corona addeventlistener

情况是我需要访问调用eventListener

的对象

例如: 如果我要添加:balls[ball]:addEventListener( "collision", removeBricks)如何在removeBricks函数中访问balls[ball]

function removeBricks(event)
    print("caller: " .. balls[ball])
    ...
end
balls[ball]:addEventListener( "collision", removeBricks)

我尝试了什么:

balls["ball"]:addEventListener( "collision", removeBricks(event, balls["ball"]))                

1 个答案:

答案 0 :(得分:0)

self -> balls[ball]
event.other -> other collided object