Jump to content

Texture.fromImage callback


canvasman
 Share

Recommended Posts

I am using PIXI's loader currently. Its working alright but one loader can only load one set of images at the time. So when I start loading, I need to wait until it finishes before adding new image urls to load AFAIK?

I would just like simple way for loading images with just callback if success. I have this hassle now with multiple loaders and adding callbacks to them if not loaded yet otherwise return loaded texture.

EDIT: oh looks like .fromImage is deprecated after v5.

Is it possible to make texture from Image() object. Would it be complicated to create own loader that way?

Link to comment
Share on other sites

Yes, it is possible to create texture from Image() please look closer, I remember that it was easy as passing ImageResource somewhere ...

No, fromImage is still a valid way, it was deprecated because there's "FROM" function now. "Texture.from".

Yes, you can just create one extra loader if you suddenly need to download one more texture.

Link to comment
Share on other sites

4 minutes ago, ivan.popelyshev said:

Yes, it is possible to create texture from Image() please look closer, I remember that it was easy as passing ImageResource somewhere ...

No, fromImage is still a valid way, it was deprecated because there's "FROM" function now. "Texture.from".

Yes, you can just create one extra loader if you suddenly need to download one more texture.

Okay! So if I wanted, I could load image to Image() object and pass that to Texture.from to create texture from it? Btw would that be syncronous task when Texture.from processes the data from Image()

Thanks for your answer :)

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