Deprecated: str_replace(): Passing null to parameter #1 ($search) of type array|string is deprecated in /var/www/vhosts/gamedevstudiogame.com/httpdocs/classes/client.php on line 124

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /var/www/vhosts/gamedevstudiogame.com/httpdocs/classes/client.php on line 124
Game dev studio

Classes

Concepts

Libraries

advertisement »

ambientSounds »

bitser »

contentPoints »

eventBoxText »

factValidity »

frameBuffer »

officeBuildingInserter »

priorityRenderer »

randomEvents »

scaling »

spritesheetParser »

statusIcons »

test3 »

util »

Objects

addDirectReceiver

Description

Add an event receiver to specific events only.

Arguments

1 table receiver

the object that will be receiving events.

2 table eventList

the list of events that this receiver can handle.

3 string methodName (optional)

the method name for handling events. If none is specified, it will fall back to the default 'handleEvent' method.

Example

-- register the receiver

events:addDirectReceiver({handleEvent = function(self, event, data)
  print("received event", event, "with data", data)
end}, 
{"someEvent"})

-- fire the event

events:fire("someEvent", {id = "someID", data = 123})