Jump to content

How to create clickable logo with object data?


Biggerplay
 Share

Recommended Posts

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

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

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

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...