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