zirma build menu
Shri

Gio,

 

I wanted to implement a build menu like the one in Zirma (where it scrolls and unbuildable items are faded out).

Is there any way you can post the pseudo code or the code for how you did that here or on in the projects area ?

 

 

thanks,

Shri

1 Comment
Gio

Hi Shri

 

I have attached the code for the menu I made for Zirma several years ago. However it's using a very old version of wade (0.8 possibly), so there must be much easier and efficient ways of doing it now.

 

The gist of it is that it's using canvas mode (not webgl) with a "source-atop" composite operation to achieve the fadeout effect. That is, using a separate layer, the background is drawn normally (with "source-over"), but its alpha fades out at the edges. Then the other sprites are drawn on top of the background using "source-atop".

 

In the js file there's some complicated logic to detect swipe gestures, but this is now handled by the engine and you can possibly replace all that by just listening for swipe events.

 

In WADE 3.0 you'll be able to write your own custom shaders so a much more efficient webgl version of the same thing will be possible.

Post a reply
Add Attachment
Submit Reply
Login to Reply