Biggerplay Posted February 28, 2014 Share Posted February 28, 2014 The Spil API has a getLogo method, which returns this.{height: 50image : "http://www.url-link-pointing-to-default-image-logo.com/default-logo.png",link : "http://www.url-link-pointing-to-default-Spil-Games-portal.com",type : "png",mime : "image/png",scale : 1style : "margin-left:10%;margin-bottom: 25%;height: 10%;"width : 202}How can I use that data with Phaser to create a clickable logo? Link to comment Share on other sites More sharing options...
Magnifisite Posted February 28, 2014 Share Posted February 28, 2014 First you have to load the logo by using the following code:game.load.image('logo_name', obj.image);You have to change obj to the result you get from the API.And for the rest you should just check out this example .http://examples.phaser.io/_site/view_full.html?d=basics&f=02+-+click+on+an+image.js&t=02%20-%20click%20on%20an%20image Link to comment Share on other sites More sharing options...
Biggerplay Posted February 28, 2014 Author Share Posted February 28, 2014 First you have to load the logo by using the following code:game.load.image('logo_name', obj.image);You have to change obj to the result you get from the API.And for the rest you should just check out this example .http://examples.phaser.io/_site/view_full.html?d=basics&f=02+-+click+on+an+image.js&t=02%20-%20click%20on%20an%20image How to make it open up the link in a new window/tab though? Link to comment Share on other sites More sharing options...
Sebi Posted February 28, 2014 Share Posted February 28, 2014 It's just plain javascript. The input listener has to execute window.open on click/tap.window.open("http://www.google.com/"); Biggerplay 1 Link to comment Share on other sites More sharing options...
Recommended Posts