mirror of https://github.com/axmolengine/axmol.git
modify event register function name
This commit is contained in:
parent
d754900b28
commit
c4cc6b5c34
|
@ -29,7 +29,7 @@ function Event:unbind(target)
|
|||
self:init_()
|
||||
end
|
||||
|
||||
function Event:onEventListener(eventName, listener, tag)
|
||||
function Event:on(eventName, listener, tag)
|
||||
assert(type(eventName) == "string" and eventName ~= "",
|
||||
"Event:addEventListener() - invalid eventName")
|
||||
eventName = string.upper(eventName)
|
||||
|
@ -50,7 +50,7 @@ function Event:onEventListener(eventName, listener, tag)
|
|||
return self.target_, handle
|
||||
end
|
||||
|
||||
Event.addEventListener = Event.onEventListener
|
||||
Event.addEventListener = Event.on
|
||||
|
||||
function Event:dispatchEvent(event)
|
||||
event.name = string.upper(tostring(event.name))
|
||||
|
|
Loading…
Reference in New Issue