Balamurugan Posted November 14, 2019 Share Posted November 14, 2019 (edited) 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 November 14, 2019 by Balamurugan Link to comment Share on other sites More sharing options...
nag0121 Posted November 15, 2019 Share Posted November 15, 2019 get the scene instance from phaser scene class to your normal class by passing it through the constructor. Link to comment Share on other sites More sharing options...
Balamurugan Posted November 15, 2019 Author Share Posted November 15, 2019 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 More sharing options...
nag0121 Posted November 20, 2019 Share Posted November 20, 2019 On 11/15/2019 at 1:25 PM, Balamurugan said: 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. Okay, But if you wanna deal with phaser content you have to go with that option only I feel. Link to comment Share on other sites More sharing options...
Balamurugan Posted December 4, 2019 Author Share Posted December 4, 2019 On 11/20/2019 at 12:15 PM, nag0121 said: Okay, But if you wanna deal with phaser content you have to go with that option only I feel. Ok, Thanks I use events emitter to communicate class. Link to comment Share on other sites More sharing options...
Recommended Posts