Jump to content

Source Code Question: Can someone explain to me how exactly the references in State or StateManager are set?


Recommended Posts

I am trying to understand the Phaser source code and came across a weird part that I just can't figure out. Where and how are the properties (references) in State set to the actual objects that we later use?

I thought that "this" might point to Phaser.Game later (i.e. by calling the Phaser.State methods from the Phaser.Game object) but printing out "this" from within a Phaser.State object does in fact return a Phaser.State object. So now I'm all confused about where these references are updated.

Link to comment
Share on other sites

9 minutes ago, Tom Atom said:

Holy hell. Thank you so much. I've been looking and grepping all over the files all night. Totally missed this!

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

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.


  • Recently Browsing   0 members

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