Sign in to follow this  
mm

add html class or id to image

Recommended Posts

These images are drawn on a canvas, so they're not HTML elements in the traditional sense, and you can't use CSS to style them.  What would you like to do with CSS, though?  Most of the things you can do with css and html tags you can do with Phaser sprites already.

Share this post


Link to post
Share on other sites

Can you explain what you mean by "retina images"? Do you just need a reference to the images themselves, or do you need a reference to what is currently being displayed? If you just need the images, you can use vanilla JS to load the images separately, outside of Phaser and have them that way. If you need what is being displayed, that is more complex, because the canvas is essentially one entire moving bitmap itself. As Cudabear said, you can't target individual images on it separately once they are drawn. But there is always some way, even if you have to just grab the bits themselves, which is supported by canvas. So it just depends on what you need. 

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.