Balamurugan

Phaser ES6 communicate Between Normal Class to Scene Class

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.