Jump to content

Phaser signals context binding


dgodov
 Share

Recommended Posts

Hello! I have a question. 

When I add a handler to signal and bind context to this one property becomes null, but it is not null right before binding.

console.log(this);      btnCheckMark.onCheckMarkBtnClicked.add(function(){        console.log(this)      }, this);

 

Here is the console output.

 

First console.log:

FarmBlueprint {game: b.Game, farmDragStop: function, farmDragStart: function, inputDownHandler: function, name: "group"…} 

Second one:

FarmBlueprint {game: null, farmDragStop: function, farmDragStart: function, inputDownHandler: function, name: "group"…}

As you can see game property is null in second case. I can not understand why.

Thanks for your help.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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