Jump to content

How to save the screen as an image file and upload it to my server?


bonjour2015
 Share

Recommended Posts

You can get the Phaser canvas data with game.canvas.toDataURL() if using the canvas renderer - you'll probably have to do this in the render function to ensure you capture everything for that frame. However if you intend to use this to live share the gameplay as it happens, this will be very, very inefficient.

 

It'd be much better in that case to send over the positions and such of objects, or even better, just the player's input, which is how many netplay engines work - though this will require some quite strict enforcement of things like repeatable random number generation etc.

 

Failing that, there are ways of sharing video feeds over WebRTC but I'll leave the research on that one to you!

Link to comment
Share on other sites

You can get the Phaser canvas data with game.canvas.toDataURL() if using the canvas renderer - you'll probably have to do this in the render function to ensure you capture everything for that frame. However if you intend to use this to live share the gameplay as it happens, this will be very, very inefficient.

 

It'd be much better in that case to send over the positions and such of objects, or even better, just the player's input, which is how many netplay engines work - though this will require some quite strict enforcement of things like repeatable random number generation etc.

 

Failing that, there are ways of sharing video feeds over WebRTC but I'll leave the research on that one to you!

 

thanks for your reply. It is a great help to me.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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