arvnik Posted August 11, 2020 Share Posted August 11, 2020 Hi! I'm currently working on a project where I need a resizable gradient texture to apply as a background to one of my sprites. I've been following the example for how to create a Gradient Resource from the documentation (https://pixijs.io/examples/#/textures/gradient-resource.js), which is working fine as long as I have WebGL enabled. When using the CanvasRenderer, however, the sprite renders without any background. This seems to be due to the upload method never getting called from CanvasRenderer.render but even if I call it explicitly it just breaks (since the gl propery isn't available on CanvasRenderer). Is there a way to achieve the same using the CanvasRenderer? I've been fiddling around with renderer.plugins.prepare in order to somehow do the upload manually but can't quite get it working. Does anyone have any experience with this? What am I missing here? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 11, 2020 Share Posted August 11, 2020 At the moment we dont have fallbacks for texture resources + CanvasRenderer. Why? Because no one implemented it. First we need alternative method that wont call "texImage2d", and second - a place where this upload will actually happen, there's no such place in CanvasRenderer. Another example in the same group should work for you. Quote Link to comment Share on other sites More sharing options...
arvnik Posted August 12, 2020 Author Share Posted August 12, 2020 22 hours ago, ivan.popelyshev said: At the moment we dont have fallbacks for texture resources + CanvasRenderer. Why? Because no one implemented it. First we need alternative method that wont call "texImage2d", and second - a place where this upload will actually happen, there's no such place in CanvasRenderer. Another example in the same group should work for you. OK, got it. After some tweaking I got the Gradient Basic example working for my scenario. Thanks! 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.