You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a new instance of the Engine the canvas element is automatically injected into the DOM and this behavior can cause problems if the document is not yet ready.
Proposal
By allowing manual mounting/injecting of the canvas element, we will have more control of the flow, eg.the game could be constructed before being used.
I ran into the problem with the document not being ready when wanted to prepare an exported game instance.
The text was updated successfully, but these errors were encountered:
@ewal As a possible workaround you can supply the canvasElementId to the engine constructor and it will use a canvas that is defined in the DOM
Thanks for the reply, @eonarheim. I tried specifying the canvasElementId but I still face the same problem since the code tries to find the element on line 760 in Engine.ts with the document being undefined.
Context
When creating a new instance of the Engine the canvas element is automatically injected into the DOM and this behavior can cause problems if the document is not yet ready.
Proposal
By allowing manual mounting/injecting of the canvas element, we will have more control of the flow, eg.the game could be constructed before being used.
I ran into the problem with the document not being ready when wanted to prepare an exported game instance.
The text was updated successfully, but these errors were encountered: