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

removeFunctionReceiver

Description

Removes an event handler added previously via addFunctionReceiver.

Arguments

1 table handler

the object that is handling an event registered previously.

2 string event

the event that the object is handling.

Example

local object = {}

function object:handleEventOne(event, data)
  print("this method handles eventOne!")
end

function object:handleEventTwo(event, data)
  print("this method handles eventTwo!")
end

events:addFunctionReceiver(object, object.handleEventOne, "eventOne")
events:addFunctionReceiver(object, object.handleEventTwo, "eventTwo")

events:fire("eventOne")
events:fire("eventTwo")

events:removeFunctionReceiver(object, "eventOne")
events:removeFunctionReceiver(object, "eventTwo")