Hello,
I have searched a bit around but haven't found a solution for my problem...
I am trying to open a window with window.open() in my Plugin but still want to support worker-mode.
Anyone has a solution for this?
Thanks very much!
Develop games in your browser. Powerful, performant & highly capable.
Are you using the addon SDK to write a plugin, or using Construct's scripting feature? This is the forum for the latter, but you mentioned a plugin.
I use the addon SDK
Moved to Plugin SDK forum.
See the section on DOM calls in the Addon SDK documentation.
Moved to Plugin SDK forum. See the section on DOM calls in the Addon SDK documentation.
Im not a 100% sure how I can use DOM calls to use window in worker mode?
For an example demonstrating how to get started, see the domElementPlugin template in the C3 plugin SDK download.
You are basically creating a DOM side script with functions to call via DOM messaging from your worker side script.
This question has come up a couple of times so I've added a new DOM Messaging plugin sample to the plugin SDK download here: https://www.construct.net/en/make-games/manuals/addon-sdk
It uses DOM messaging to set and get the document title, since that is a simple DOM API that can't be used in a worker.
This question has come up a couple of times so I've added a new DOM Messaging plugin sample to the plugin SDK download here: https://www.construct.net/en/make-games/manuals/addon-sdk It uses DOM messaging to set and get the document title, since that is a simple DOM API that can't be used in a worker.
Got it to work now, thanks!