Barclays Posted June 9, 2021 Share Posted June 9, 2021 Hello! I'm quite new to pixi.js community. I’m trying to add SVG with foreignObject to Pixi and I guess I have some understanding issue, because my example works well with default 2d canvas but looks way blurry in Pixi’s WebGL. Any tips for this case? https://stackblitz.com/edit/pixijs-text-rendering?file=index.ts Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 9, 2021 Share Posted June 9, 2021 (edited) > width=100 , height=200 .. either modify svg itself, either make sure that parameters for size of texture go through TextureResource. width: 400, height: 400, resourceOptions: { width: 400, height: 400, } that's what i tried to add in the options, but it has a problem: fromUrl thinks that image is an Image and not SVG, so it doesnt create SVGResource , so SVGResource cant resize temporary canvas on fly. OK, so i I ditched fromUrl and created resource directly. https://stackblitz.com/edit/pixijs-text-rendering-u4pfte it still has problems, and its yours to debug, place breakpoints in SVGResource and enjoy the life basically, you have to pass correct args to drawImage somehow, and then make sure that BaseTexture size (actual gl texture!) is correct too. Alternatively, you should search pixijs github issues for cases like that, because, honestly, by trying to use SVG with pixi you became member of club "how to get SVG working for everyone without a problem" l use v6 because i honestly dont remember when in v5 we fixed issue with not passing resourceOptions to resource. Edited June 9, 2021 by ivan.popelyshev Barclays 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.