Drag[en]gine Script Module DragonScript
1.3
|
Listener Implementation calling code block. More...
Public Member Functions | |
void | addListener (String event, Block ablock) |
Add block as listener for event if not added already. More... | |
void | addListener (String event, Listener listener) |
Add listener for event. More... | |
BlockListener | new () |
Create global events. More... | |
BlockListener | new (Block ablock) |
Create block listener. More... | |
void | removeListener (String event, Listener listener) |
Remove listener from event. More... | |
void | sendEvent (String event) |
Send event. More... | |
void | sendEvent (String event, Object source) |
Send event. More... | |
void | setBlock (Block ablock) |
Set code block. More... | |
![]() | |
void | onEvent (Object source, Object data) |
Event fired. More... | |
Listener Implementation calling code block.
Code block receives two Object type parameters. The first parameter is the source sending the event and the second parameter the optional event data.
void Dragengine.Utils.GlobalEvents.BlockListener.addListener | ( | String | event, |
Block | ablock | ||
) |
Add block as listener for event if not added already.
Code block receives two Object type parameters. The first parameter is the source sending the event and the second parameter the optional event data.
Adding a block listener creates an instance of BlockListener internally. For this reason you can not remove a block listener. If you need to remove block listeners create an instance of BlockListener yourself and add it.
It is save to add listener while event is in progress of being send.
void Dragengine.Utils.GlobalEvents.BlockListener.addListener | ( | String | event, |
Listener | listener | ||
) |
Add listener for event.
It is save to add listeners while event is in progress of being send.
EInvalidParam | Listener has been already added to event. |
BlockListener Dragengine.Utils.GlobalEvents.BlockListener.new | ( | ) |
Create global events.
BlockListener Dragengine.Utils.GlobalEvents.BlockListener.new | ( | Block | ablock | ) |
Create block listener.
Code block receives two Object type parameters. The first parameter is the source sending the event and the second parameter the optional event data.
void Dragengine.Utils.GlobalEvents.BlockListener.removeListener | ( | String | event, |
Listener | listener | ||
) |
Remove listener from event.
It is save to remove listeners while event is in progress of being send.
EInvalidParam | Listener is not present for event. |
void Dragengine.Utils.GlobalEvents.BlockListener.sendEvent | ( | String | event | ) |
Send event.
Same as sendEvent(String,Object,Object) but using null as source and data.
void Dragengine.Utils.GlobalEvents.BlockListener.sendEvent | ( | String | event, |
Object | source | ||
) |
Send event.
Same as sendEvent(String,Object,Object) but using null as data.
void Dragengine.Utils.GlobalEvents.BlockListener.setBlock | ( | Block | ablock | ) |
Set code block.
Code block receives two Object type parameters. The first parameter is the source sending the event and the second parameter the optional event data.