Jump to content

Phaser + DOM - best practices?


RyuMaster
 Share

Recommended Posts

Hi! I need to have several DOM elements displayed on top of phaser canvas. It is going to be swf, some input forms;

 

I'm filling full screen with the application, using SHOW_ALL; So, basically it scales;

 

I can use div with absolute position to overlay on top of phaser canvas, calculate scaling;

 

But this is somehow complex stuff, in overall, and I'd like to look on some examples on tutorials. Can anyone share a link or code snippet? For example, I will have swf inside DIV. What is the best way to overlay it on top of phaser, and resize on screen changes? Something like that.

 

I can imagine how to code it, but I'd like to avoid potential minefields and get some advices on how this is handled properly, as I never did all those DOM operations.

Link to comment
Share on other sites

I think you just have to do your stuff the normal way, Phaser just creates a canvas in an div wrapper, il you have to add extra HTML over it, use absolute positionning like you normally do in HTML. You may consider pausing Phaser if your overlay hide the entire canvas, with game.paused = true;

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...