Is there a way to pause and cancel wade.fadeOutLayer()
Shri

Gio,

 

I was trying to add a pause feature to gone batty. Pausig the game action is pretty simple, but I'm not sure if/how I can pause the fadeOutLayer which gives the day/night effect ?

Along the same lines, is there a way to cancel the fadeOutLayer ?

 

thanks for any assistance,

Shri

All 5 Comments
hermes

I'd like to know too  if this is possible it'd be useful in a couple of cases. If not, is it something that you could add for WADE 1.4? :D

Gio

Hi

 

It isn't really straightforward to do that at the moment (though it's technically possible with a minor hack). Anyway, we're releasing WADE 1.3.1 in the next couple of days and we can easily add a function to pause the fading of layers, and the simulation in general (that is all main loops that are currently running).

Gio

We've just released WADE 1.3.1, which includes the feature you requested.

 

You can do wade.pauseSimulation() to pause the whole simulation, or wade.pauseSimulation(mainLoopName) to pause a single main loop.

 

Layers fading in and out use a main loop internally, if you wanted to only pause the layer fading (say that it's layer 7) you could do:

wade.pauseSimulation('__wade_fadeLayer_7');

Since you requested this a coupe of days ago there wasn't really much time for some proper testing of this feature - it does seem to work, but I'd appreciate if you could give it a go and let us know if there are any problems.

Shri

Gio,

 

I added a pause and resume game buttons into gone batty - check it out on my website. - it seems to be working as advertised.

 

As an aside, it would be nice if in a future version you could also catch and dismiss all events except for maybe an exclusion on the object to resume the game i.e. wade.pauseSimulation('pauseButton', 'onClick') would pause the simulation and only let through the onClick event on the pauseButton scene object. All other events would be dismissed, so they don't get queued and fire once the game is resumed. 

Or maybe you can already do this and I am just not aware ?

 

Also, thanks for the quick turnaround on wade 1.3.2 - that is also running on my site - and it seems to be working as advertised.

 

Sorry to hear about England in the W.C. but at least Italy still has a shot (Forza Azzurri !)

 

cheers,

Shri

Gio

You can use wade.stopInputEvents() and wade.restartInputEvents(), but currently there's no way to exclude some specific events. It's a good suggestion though, I'll see what we can do for the next release.

Post a reply
Add Attachment
Submit Reply
Login to Reply