Jump to content

Phaser ES6 communicate Between Normal Class to Scene Class


Balamurugan
 Share

Recommended Posts

I want to communicate between normal class to Phaser scene class. How to do that ?

Normal Class:-

export default class checkConnection
{
i need to call the scene class ?
}

Scene class:-

import { Scene } from ‘phaser’;

class connectionLost extends Scene {
constructor() {
super({ key: connectionLost });
}

/**

create
*/
create()
{
//Show Popup Contains connection Lost Message.
}
}

export default connectionLost;

Lots of them tells can’t call normal class to scene class. please Go to trigger custom Window event. Any-other option there to call. Please share your Knowledge.

Edited by Balamurugan
Link to comment
Share on other sites

31 minutes ago, nag0121 said:

get the scene instance from phaser scene class to your normal class by passing it through the constructor.

I can't pass the scene. Becoz Smartfox server automatically throw's connection lost event to "checkConnection" class. R u understand what i am telling.

Link to comment
Share on other sites

  • 2 weeks later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...