Appearance
scene.gameController
Properties
controllers read-only
- Type: Array<GameController>
- Connected controllers, in connection order.
Methods
off()
javascript
scene.gameController.off(id: string): voidRemove a subscription made with on.
Parameters:
id(string) - Id returned fromon.
Returns: void
on()
javascript
scene.gameController.on(type: string, listener: any): string | anySubscribe to controllers connecting or disconnecting. Controllers that are already connected fire connect for a new subscriber on the next frame, never inside on. Subscriptions end when the scene changes.
Example:
javascript
if (environment.features.has('gameController')) {
scene.gameController.on('connect', function (controller) {
console.log('Connected: ' + controller.name);
});
}Parameters:
type(string) -"connect"or"disconnect".listener(any)
Returns: string | any