GamePauseOnOffPress:function(){
this.node.on(cc.Node.EventType.TOUCH_START, function (event) {
// Pause Button Press 1 Pause Game
var pausetext=this.getComponentInChildren(cc.Label);
this.countpause++;
**pausetext.string = "PAUSE";**
cc.audioEngine.playEffect(this.buttonsoundpause);
cc.game.pause();
// Pause Button Press 2 Unpause Game
if(this.countpause>=2){
cc.game.resume();
**pausetext.string = "";**
this.countpause = 0;
}},this);},
When I press the button onced it’s supposed to display via cc.label PAUSE, and when I press another time, blank the string…This works via simulator, and when I export to apk or ipa, however, it doesn’t show string PAUSE on Web export…? Any ideas…God Bless…
Thanks for the help, yes, it doesn’t work on Web Export, I can see that it works on simulator, it shows the PAUSE string label, but during the browser testing, it doesn’t show, I’m going to export another DESKTOP , and upload to server, and see. In fact in Module Config, I have checked Label. God Bless…
If not mistaken, I think, this could be a bug ? I just test it out with a regular button, and applied a child node label(cc.label), and used the code above, and still it displays in simulator, but not on web. Just like in export, I export to apk, and ipa, and it works as it’s supposed to. But when I export to Web Desktop, it doesn’t display the PAUSE string. The code seems to be working, by pausing the game, and then press, unpause game, but it just doesn’t display the string = PAUSE like below:
Maybe, it’s my code, but it seems very strange though…God Bless…
So then, what would be the correct implementation code wise, so it would work both in native and web? The reason is that if i touch the button, it would pause the game, then if i touch again, it would resume the game…God Bless…