Jump to content

add html class or id to image


mm
 Share

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.

Link to comment
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. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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