Search code examples
easeljscreatejs

easeljs - modal dialog box?


How can I implement this? Any advices?


Solution

  • The way I've implemented this in Flash was to put a transparent image the size of the entire canvas over everything, and then the dialog box on top of that. The dummy image will capture and ignore all mouse clicks, not letting the user interact with anything other than the dialog box.

    This should work with EaselJS. You can also do stuff like make the dummy image a semi-transparent grey, so it makes everything outside the modal dialog darken.

    If you also need to have all activity outside of the box stop, I think the easiest way is to use the Ticker.setPause() function to stop tick() events from being sent.

    Note: This only is modal within the canvas, and doesn't effect the browser or the rest of the web page.