Options
All
  • Public
  • Public/Protected
  • All
Menu
export

Hierarchy

  • ScenePlugin
    • PhaserMatterCollisionPlugin

Index

Methods

addOnCollideActive

addOnCollideEnd

addOnCollideStart

boot

  • boot(): void
  • This method is called when the Scene boots. It is only ever called once.

    By this point the plugin properties scene and systems will have already been set.

    In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run. Here are the Scene events you can listen to:

    • start
    • ready
    • preupdate
    • update
    • postupdate
    • resize
    • pause
    • resume
    • sleep
    • wake
    • transitioninit
    • transitionstart
    • transitioncomplete
    • transitionout
    • shutdown
    • destroy

    At the very least you should offer a destroy handler for when the Scene closes down, i.e:

    var eventEmitter = this.systems.events;
    eventEmitter.once('destroy', this.sceneDestroy, this);
    

    Returns void

destroy

  • destroy(): void

init

  • init(data?: any): void
  • The PluginManager calls this method on a Global Plugin when the plugin is first instantiated. It will never be called again on this instance. In here you can set-up whatever you need for this plugin to run. If a plugin is set to automatically start then BasePlugin.start will be called immediately after this. On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead.

    Parameters

    • Optional data: any

      A value specified by the user, if any, from the data property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's install method (if started manually).

    Returns void

removeAllCollideActiveListeners

  • removeAllCollideActiveListeners(): void

removeAllCollideEndListeners

  • removeAllCollideEndListeners(): void

removeAllCollideListeners

  • removeAllCollideListeners(): void

removeAllCollideStartListeners

  • removeAllCollideStartListeners(): void

removeOnCollideActive

  • removeOnCollideActive<T, K>(config: RemoveCollideConfigAB<T, K>): void
  • removeOnCollideActive<T>(config: RemoveCollideConfigA<T>): void

removeOnCollideEnd

  • removeOnCollideEnd<T, K>(config: RemoveCollideConfigAB<T, K>): void
  • removeOnCollideEnd<T>(config: RemoveCollideConfigA<T>): void

removeOnCollideStart

  • removeOnCollideStart<T, K>(config: RemoveCollideConfigAB<T, K>): void
  • removeOnCollideStart<T>(config: RemoveCollideConfigA<T>): void

shutdown

  • shutdown(): void

start

  • start(): void

stop

  • stop(): void
  • The PluginManager calls this method on a Global Plugin when the plugin is stopped. The game code has requested that your plugin stop doing whatever it does. It is now considered as 'inactive' by the PluginManager. Handle that process here (i.e. stop listening for events, etc) If the plugin is started again then BasePlugin.start will be called again. On a Scene Plugin, this method is never called.

    Returns void

subscribeMatterEvents

  • subscribeMatterEvents(): void

unsubscribeMatterEvents

  • unsubscribeMatterEvents(): void

Private addOnCollide

  • addOnCollide(map: ListenerMap, config: InternalCollideConfig): void

Private addOnCollideObjectVsObject

Private checkPairAndEmit

Private onCollisionActive

  • onCollisionActive(event: CollisionActiveEvent): void

Private onCollisionEnd

  • onCollisionEnd(event: CollisionEndEvent): void

Private onCollisionEvent

  • onCollisionEvent(listenerMap: ListenerMap, eventName: string, event: MatterCollisionEvent): void

Private onCollisionStart

  • onCollisionStart(event: CollisionActiveEvent): void

Private removeOnCollide

  • removeOnCollide(map: ListenerMap, config: InternalCollideRemoveConfig): void

Constructors

constructor

Properties

events

events: EventEmitter = ...

Readonly pluginKey

pluginKey: string

The key under which this plugin was installed into the Scene Systems.

This property is only set when the plugin is instantiated and added to the Scene, not before. You can use it during the boot method.

Protected game

game: Game

A reference to the Game instance this plugin is running under.

Protected pluginManager

pluginManager: PluginManager

Protected scene

scene: Scene

Protected systems

systems: Systems

A reference to the Scene Systems of the Scene that has installed this plugin. Only set if it's a Scene Plugin, otherwise null. This property is only set when the plugin is instantiated and added to the Scene, not before. You can use it during the boot method.

Private collisionActiveListeners

collisionActiveListeners: ListenerMap = ...

Private collisionEndListeners

collisionEndListeners: ListenerMap = ...

Private collisionStartListeners

collisionStartListeners: ListenerMap = ...