I am implementing a Game HUB with 4 games inside it.
Game HUB is done using basic HTML 5 scripting which would have links from where i would load Play canvas games. Now from the games how can i load back the parent address HTML5 page.
I am implementing a Game HUB with 4 games inside it.
Game HUB is done using basic HTML 5 scripting which would have links from where i would load Play canvas games. Now from the games how can i load back the parent address HTML5 page.
You could add a button somewhere on your game that links to the parent page. For example you could add a link somewhere using HTML, or you could add a button again with HTML that calls window.open(url)
when you click on it. Or you could use the sprite
library here to add a button https://github.com/playcanvas/sprites that does that on the click
event.
Plenty of examples on UI around the forum and in the tutorials.
Wow… Thanks for a speedy reply
These are my first days on PlayCanvas :->
window.open(“www.google.com”); // Nothing happening as of now
Am i doing some thing wrong
//-----------------------------------------------------------------------------------
GameManager.prototype.initialize = function()
{
window.open(“www.google.com”);
};
//-----------------------------------------------------------------------------------
Did the above code to check the loading of URL page. Not working
I Got the Solution : window.location.href = “http://www.google.com”;
Usually window.open
needs to be called as the result of user interaction, so inside a click event handler for example, otherwise browsers will block it.