If we have an HTML5 game running in a parent window, is it possible to send messages into the game from externally? Can we target into a running game if we know a desired javascript function exists in the game, can the game start an event listener in the parent window or do we have to go to some larger solution such as pinging a shared webservice or websockets backend?
Thanks in advance
Andrew
Develop games in your browser. Powerful, performant & highly capable.
If you are happy to write JavaScript code, you can communicate between local frames and windows using the postMessage() API.
Thanks, 8 had seen that api but what about communication in the other direction, is that possible? For example, we may have a menu item in the main window that would pause the game, disable sound or start a specific game scene. Thanks
Yes, it covers that.