Jump to content

PhaserJS - Render loaded image on html


Ziden
 Share

Recommended Posts

I have an app thats a mix of phaser an react. 

Im loading some images as follows:

 

this.load.image('bone', 'assets/images/bone.png');

 

How would it be possible to dynamically get the image of a sprite, and render into html ?

 

Something like (example)

 

const image = sprite.image;
return <img src={image}/>

 

Is that somehow possible ?

Also, is listing images possible ? (get all loaded images)

What im tryng to achieve is a panel that shows the sprite image, and you could change the sprite image to another image (maye even choosing an image from your pc)

Thanks for any help !

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