Jump to content

Pixi.js Sprite from doesn`t work correctly WebGL


NoleDjok
 Share

Recommended Posts

you should update texture every time it is changed. Im not sure from() does it.

Manually create it one time:

var tex = Texture.from(myCanvas);

you can use sprites with that texture.

now, every time you change something on that canvas, you should do "tex.update()"

Edited by ivan.popelyshev
Link to comment
Share on other sites

My advice - you should clone pixijs repo to your computer, open in separate IDE window and watch inside whatever methods/classes you are using. from() method is very general thing that is ok to use without knowing what it does in demos. In production - you have to be sure.

Btw, usually people use Rope with texture (maybe with transparent edge) instead of canvas lines.

Link to comment
Share on other sites

22 hours ago, ivan.popelyshev said:

you should update texture every time it is changed. Im not sure from() does it.

Manually create it one time:


var tex = Texture.from(myCanvas);

you can use sprites with that texture.

now, every time you change something on that canvas, you should do "tex.update()"

Thanks for respond. It turned up helpful. I will learn about Rope with texture. It`s interesting.

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