Please can we have a tutorial on how to create a SIMPLE HTML/CSS menu that can be used to launch a scene using the scene ID. As a bonus it would be great to know how to include a small javascript file that will load and run AFTER the HTML/CSS files have rendered in the DOM.
Same problem here - http://developer.playcanvas.com/en/user-manual/assets/html/ â I donât know if anyone else has this problem but I find the docs to be very hard to decipher. The new tutorials sections is really promising though! Step by step instructions are awesome!
And lastly I would have thought it would be possible to open a scene simply by running a few lines of code from inside Chrome developer toolsâŚsomething like this- âWhateverTheNameOFTheAPP.prototype.loadLevel(ânameOfSceneâ || âSceneIDâ)â ; WhateverTheNameOFTheAPP.prototype.deystroyScene(ânameOfSceneâ || âSceneIDâ);
There has to be a simple way to create a html menu and then use that menu to fire off some javascript to load a scene or do anything else.
To load the scene. This wonât unload/destroy the existing scene though so you will have both scenes loaded. Again, look at the changing scenes example to see how it handles it.
I get a null error very randomly after switching scenes back and forth 10-30 times
on this function call - âpc.app.root.findByName(âModelViewerâ).destroy();â
Look at the ram on Chrome go up to 1gb if you switch scenes 30 or so times (I can reproduce this bug every time).
I loose the event listener on my back button after 10 - 30 scene switches⌠or the z-index gets broken or something else ⌠not sure yet.
There is still a few things that I can try and I have only spent 6 or so hours debugging it so will carry on with different methods tomorrow. I might try to not use the scene feature in PC and instead just hide and show the models when I need them. If you have any tips on hiding and showing the models it would be appreciated as I cannot find it in the api reference.
Loving playcanvas so far, despite its quirks! And very happy to see good + quick responses in the forum, it makes all the difference thank you so much.
Generally the issue with the project is that when you load a scene hierarchy, it creates new entities and therefore new script components attached.
So for example, ui.js that is responsible for adding CSS and HTML to the document is being created every time the user goes back to the menu. This means that the same HTML is being added each time so you get this:
Iâm not sure what is causing the RAM usage to go up so it be something I will look at.
Personally for as project like this, I would go with a single scene and hide/show the HTML menu and various models. It should be easier to manage as well.