Jump to content

Open link in new window?


Ninjadoodle
 Share

Recommended Posts

@enpu

Oh ok, sorry I misunderstood. In that case, I'm already doing this ...

game.scene.buttonFacebook = new game.Sprite('buttonFacebook.png');

game.scene.buttonFacebook.position.set(416, 736);
game.scene.buttonFacebook.anchorCenter();
game.scene.buttonFacebook.interactive = true;
game.scene.buttonFacebook.addTo(game.scene.ib);

game.scene.buttonFacebook.mousedown = function() {
    window.open('https://www.panda2.io');
};

 

Link to comment
Share on other sites

@Ninjadoodle

Your code sure is correct. Mobile Safari seems to block all pop-ups by default, that can be changed from settings.

You can also just change the url with

window.location.href = 'https://www.panda2.io';

Though that will change the url of the current browser window, meaning it will completely exit your game. But that code should work anywhere, not just at interactive function.

I just fixed window.open to work on the editor, will be on next release.

Also need to make changes to Panda Remote so it works there too, and when exporting as native app.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...