button click during me.state.pause still active even though updateWhenPaused = false;

66 views
Skip to first unread message

ayakashi.a...@gmail.com

unread,
Jan 31, 2014, 10:17:28 PM1/31/14
to mel...@googlegroups.com
Hello, i have problem GUI_Object during pause state.

i have a dialog box that pop out another dialog box for confirmation.

i set when this second dialog box appears, the game is paused.  the pause works fine, and also the resume.

However, i found out that any button is not paused when it is paused. so if i click any other button in the viewport, (even if it was overlayed by the 2nd dialogbox button), it still receive input and do their stuff (ie. if i set one to change state, then if i click it, the game will change state).

how could i make this 'background' buttons to not active when state is paused? setting this updateWhenPaused to false doesn't seem to do the trick....

Jay Oster

unread,
Feb 3, 2014, 5:14:53 PM2/3/14
to mel...@googlegroups.com, ayakashi.a...@gmail.com
Yeah. :(

This is actually a pretty big problem. melonJS handles all events outside of the main thread. There's a ticket that I filed for this exact issue: https://github.com/melonjs/melonJS/issues/396

For now, you will have to explicitly check the result of me.state.isPaused() in your click handlers.

margaret laroche

unread,
Feb 4, 2014, 8:55:13 AM2/4/14
to mel...@googlegroups.com, ayakashi.a...@gmail.com
i see, thanks for the info and the link to the ticket! i was afraid it was caused by my codes *again*.... hahaha.

currently, checking me.state.isPaused() is also what I do to solve the problem...

Jay Oster

unread,
Feb 4, 2014, 4:09:37 PM2/4/14
to mel...@googlegroups.com, ayakashi.a...@gmail.com
Glad the workaround is ok for you! The event system needs a pretty big overhaul that will fix little issues like this. :) 
Reply all
Reply to author
Forward
0 new messages