new TriggerRegion()
Methods
-
fromJSON(json) → {TriggerRegion}
-
Restores this instance from the given JSON object.
Parameters:
Name Type Description json
Object The JSON object.
-
toJSON() → {Object}
-
Transforms this instance into a JSON object.
Returns:
Object -The JSON object.
-
touching(entity) → {Boolean}
-
Returns true if the bounding volume of the given game entity touches/intersects the trigger region. Must be implemented by all concrete trigger regions.
Parameters:
Name Type Description entity
GameEntity The entity to test.
Returns:
Boolean -Whether this trigger touches the given game entity or not.
-
update(trigger) → {TriggerRegion}
-
Updates this trigger region. Must be implemented by all concrete trigger regions.
Parameters:
Name Type Description trigger
Trigger The trigger that owns this region.