OptionalonCalled just after an announcement was made by the room host.
The announcement message.
The color of the announcement message. Range: -1 <= color < 16777216.
Utils.numberToColor function.-1 means transparent color.The style of the announcement message. Must be one of the following:
The sound of the announcement message. Must be one of the following:
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an announcement has been sent using the improved announcement api.
The announcement message. ( max length = 1000 )
OptionalcssVar: stringThe cssVar of the announcement message.
Optionalsound: stringThe sound of the announcement message.
OptionaltargetId: numberId of the player who will receive this announcement. If this value is null, the announcement is sent to everyone.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an "auto" event has been triggered to automatically move at least one, at most two players from spectators to teams.
Id of the first player affected by this event.
Id of the team which the first player was moved into.
Id of the second player affected by this event, or null if there was only one spectator when this event was triggered.
Id of the team which the second player was moved into, or null if there was only one spectator when this event was triggered.
Id of the player who has triggered the event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game clock has been paused/resumed.
Whether the game will be paused(1) or resumed(0).
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a collision has happened between two discs.
Id of the first collided disc.
The player's id that the first disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the second collided disc.
The player's id that the second disc belongs to. If the disc is not a player's disc, this value will be null.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a collision has happened between a disc and a plane.
Id of the collided disc.
The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the collided plane.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a collision has happened between a disc and a segment.
Id of the collided disc.
The player's id that the disc belongs to. If the disc is not a player's disc, this value will be null.
Id of the collided segment.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after game input controls have been modified.
Type of the operation. (0: add, 1: remove)
Parameters for the specific operation.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after room.directionActive has been changed.
New directionActive value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current elapsed time has been changed.
New elapsed time value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has ended.
Id of the team that won the game.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has been paused or resumed.
Whether the game has been paused or not.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has been started.
Id of the player who has started the game.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has been stopped.
Id of the player who has stopped the game.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a game tick has occurred. This will run a lot of times per second. Be careful not to make too many calculations here, otherwise the game might slow down.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a kick-off event has occurred.
OptionalcustomData: anyvoid or a custom data to pass to the next callback.
OptionalonCalled just after the room's kick rate limit has been changed.
The new min part of kick rate limit.
The new rate part of kick rate limit.
The new burst part of kick rate limit.
Id of the player who has changed the kick rate limit.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max end ticks has been changed.
New max end ticks value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max goal ticks has been changed.
New max goal ticks value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current max pause ticks has been changed.
New max pause ticks value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after room's overtime limit has been changed.
The desired overtime limit of the game.
OptionalcustomData: anyvoid or a custom data to pass to the next callback.
OptionalonCalled just after the ping values for all players have been updated.
The updated list of ping values for each player in the same order as the player list in the current room's RoomState object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a custom sound has been played.
Name of the sound to be played.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player's admin rights have been given/taken.
Id of the player whose admin rights have been given/taken.
The new admin rights status of the player whose id is id.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has changed his/her avatar.
Id of the player who has changed his/her avatar.
The new avatar value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the ball has been kicked.
Id of the player who kicked the ball.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a chat message has been received.
Id of the player who has sent the chat message.
The chat message.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has activated or deactivated his/her chat indicator. This happens when a player focuses/loses focus on the chat input component in the website.
Id of the player whose chat indicator has been activated/deactivated.
Whether the chat indicator has been activated or not.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the cssVar attribute of a player has been changed.
Id of the player whose cssVar will be modified.
New cssVar value of the player.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the direction of an individual player was changed. room.state.directionActive must be true for this to work.
Id of the player whose energy values will be modified.
New direction value of the player.
OptionalcustomData: anyvoid or a custom data to pass to the next callback.
OptionalonCalled just after a disc object has been assigned to a player object.
The new Player object that has just been assigned a disc object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a disc object has been removed from a player object.
The Player object whose disc object has just been removed.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the energy of an individual player has been altered manually.
Id of the player whose energy values will be modified.
New values. Order of values is supposed to be: [energy, kEnergyGain, kEnergyDrain]. null means no change for each value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has changed his/her headless avatar.
Id of the player who triggered this event.
The new headless avatar value.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player's input has been changed.
Id of the player whose input has been changed.
The new input value of the player.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has joined the room.
The data representation of the player that has just joined the room.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has left the room.
The player who has left the room.
The reason of leaving the room. If null, the player has left by himself/herself.
Whether the player has been banned or not. If reason is null, this value is ignored.
Id of the player who has kicked/banned the player. If reason is null, this value is ignored.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player object has been created. This callback can be used to define custom properties inside all player objects.
The new Player object that has just been created.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current skin(textureId) of a player has been updated.
Id of the player whose skin will be modified.
New skin value of the player.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the order of players have been changed.
The ids of players that were removed from the room's players list, reordered to match the order in idList and added back to the room's players list.
The ids of players that were removed from the room's players list, reordered to match the order in idList and added back to the room's players list.
Whether to add the players to the top or bottom of the room's players list.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player's synchronization status has changed.
Id of the player whose synchronization status has changed.
The new synchronization status.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a player has been moved to a different team.
Id of the player who has been moved to a different team.
Id of the player's new team.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the player positions have been reset. This event happens just after a new game has been started or a goal has been scored. The player positions are reset to their corresponding spawn points defined in the current room's Stadium object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the name of the room has been changed.
The new room name.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's properties have been changed.
The properties that were changed. The current structure of this object is as follows:
props = {
name: string | null,
password: string | null,
fakePassword: boolean | null,
geo: GeoLocation | null,
playerCount: int | null,
maxPlayerCount: int | null
}
Note that only the changed keys will show up in props.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after room.runDefaultGameLogic has changed.
Whether the default game logic is active(1) or passive(0).
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the score limit has been changed.
The new score limit value.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a disc's properties have been modified.
The id of player or disc whose disc properties have changed.
The type of object. Must be one of the following:
Must consist of the following properties of the disc in the same order: [x, y, xspeed, yspeed, xgravity, ygravity, radius, bCoeff, invMass, damping].
Must consist of the following properties of the disc in the same order: [color, cMask, cGroup].
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a new stadium object has been added.
Type of the object to be added.
An object that is supposed to contain all parameters required to add that type of object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's current stadium has been changed.
The room's new Stadium object.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an existing stadium object has been removed.
Type of the object to be removed.
Id of the object to be removed.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after an existing stadium object has been updated.
Type of the object to be updated.
Id of the object to be updated.
An object that is supposed to contain all parameters required to update that type of object.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a team's colors have been changed.
The team that colors have been changed.
The new team colors value.
Id of the player who has changed the team colors.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after a goal has been scored.
Id of the team that scored the goal.
Id of the goal object that the ball went in.
The goal object that the ball went in.
Id of the ball disc that caused the goal.
The ball disc that caused the goal.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current team scores has been changed.
Id of the team whose score is desired to be changed.
New score for the team.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the room's teams have been locked/unlocked.
The room's new teams lock value.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the game has ended by timeout.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the time limit has been changed.
The new time limit value.
Id of the player who has triggered this event.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalonCalled just after the current contents of a css variable has been altered.
Name of the css variable..
New value of the css variable.
OptionalcustomData: anythe custom data that was returned from the previous callback.
void or a custom data to pass to the next callback.
OptionalrenderThis callback should always be defined, since this function holds the main purpose of the Renderer class.
All rendering logic is supposed to reside inside this function. You should use room.extrapolate function
inside this callback with ignoreMultipleCalls=true for smooth movement of objects. This callback is used
internally by the game engine inside window.requestAnimationFrame callback.
void.
These events can only be triggered by the room's host.