NoleDjok Posted June 17, 2020 Share Posted June 17, 2020 There is a function where I draw lines on htmlcanvas. After drawing I create Pixi.Sprite from this canvas. On Canvas renderer everything works OK, but when I swich on WebGl something goes wrong. Only first line is drawn. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 17, 2020 Share Posted June 17, 2020 (edited) 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 June 17, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 17, 2020 Share Posted June 17, 2020 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. Quote Link to comment Share on other sites More sharing options...
NoleDjok Posted June 18, 2020 Author Share Posted June 18, 2020 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. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.