Sebastien Posted June 2, 2017 Share Posted June 2, 2017 Hi, I have several buttons in my game and I want them to disappear when I click on it. But it seems that the event "onInputOut" is not fired when I set the property button.visible = false in the callback function of the button. Is this a normal behaviour ? Because this causes some problems in my game logic. Is there a way to force the event "onInputOut" to be launched ? I tried button.onInputOut.dispatch() but it does not work. Thanks Link to comment Share on other sites More sharing options...
samme Posted June 2, 2017 Share Posted June 2, 2017 I think hiding a button while it's underneath the cursor doesn't count as inputOut. You would have to move the cursor off the button, possibly while it's still visible. You can do either button.onInputOutHandler(button, pointer); // or button.onInputOut.dispatch(button, pointer); You can use the pointer reference you receive in the click handler. Link to comment Share on other sites More sharing options...
Sebastien Posted June 4, 2017 Author Share Posted June 4, 2017 I did what you said, and it lauched the onInputOut event, however a problem persists. When I click on a construction site to build a tower, I see my 4 buttons, and when the cursor is over one of these buttons, the border of the button gets brighter. When I click on one of these button, a tower is getting build and the 4 buttons disappear. But if after that I click on another construction site in the map, the button corresponding of the type of tower I builded earlier still is visually in his "over" state, judging by his border which is brighter. Link to comment Share on other sites More sharing options...
Sebastien Posted June 4, 2017 Author Share Posted June 4, 2017 Well, it seems that adding this button.forceOut = true; solved this problem samme 1 Link to comment Share on other sites More sharing options...
Recommended Posts