World of Hello
|
an event listener. More...
#include <event.h>
Public Member Functions | |
void | setEventListener (ElementEvent event, function func,...) |
sets a function to run on the given event. Removes all other event listeners of the same event type. More... | |
void | addEventListener (ElementEvent event, function func,...) |
adds a function to run on the given event. More... | |
an event listener.
Certain classes (such as element, mesh, and mouse) derive all of the functions in this class.\n This means that any element may use these by using something like "element:addEventListener(Event.onButtonPressed, function() end)".\n WARNING: Events are not passed through the server when an object that allows event listeners is sent. If you need these to send, you'll need to listen for server events and add them yourself, or add values as properties to the object and use them.\n NOTE: See the Events tab for usable events.
void event::addEventListener | ( | ElementEvent | event, |
function | func, | ||
... | |||
) |
adds a function to run on the given event.
Runs the given function and passes the given arguments (if any) to the function when the event occurs.\n See the Events tab for the ElementEvent definition and how to use it.
The | event that triggers the function. |
The | function to call when clicked. |
(optional) | Any number of arguments of any type to pass to the function. |
void event::setEventListener | ( | ElementEvent | event, |
function | func, | ||
... | |||
) |
sets a function to run on the given event. Removes all other event listeners of the same event type.
Runs the given function and passes the given arguments (if any) to the function when the event occurs.\n Setting an event removes all other functions for this event. If you want to add an additional event instead, look at setEventListener().\n See the Events tab for the ElementEvent definition and how to use it.
The | event that triggers the function. |
The | function to call when clicked. |
(optional) | Any number of arguments of any type to pass to the function. |