robtacular Posted April 25, 2021 Share Posted April 25, 2021 If I have a collection of shapes (rectangles in this case), how can I scale my entire scene without the border widths changing? I'm trying to create a zoom feature and my scene is essentially a collection of wireframe polygons. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 25, 2021 Share Posted April 25, 2021 the only way to do it right now is nativeLine. Yes, pixijs is so many years and we still dont have adaptive scaling for lines. Quote Link to comment Share on other sites More sharing options...
robtacular Posted April 25, 2021 Author Share Posted April 25, 2021 (edited) I'm having trouble understanding the docs: https://pixijs.download/v4.8.1/docs/PIXI.Graphics.html#nativeLines Where do I set this value? I'm on v6. I tried setting it this way, const graphics = new PIXI.Graphics({ nativeLines: true }); ...but I get all variety of errors, this being one of them. I get others if I comment out every line where I call any method on the graphics instance, and I still get errors. this._geometry.drawShape is not a function at Graphics.drawShape (graphics.js:2805) at Graphics.startPoly (graphics.js:2473) at Graphics.beginTextureFill (graphics.js:2692) at Graphics.beginFill (graphics.js:2671) at main.js:96 at Array.forEach (<anonymous>) at paintCandles (main.js:81) at main.js:100 While I'm asking about this, is there a part of the library to help with zoom and pan calculations? The project I'm working on is a charting system, and it needs to load historical data as the user zooms and pans back into the older data. Edited April 26, 2021 by robtacular Quote Link to comment Share on other sites More sharing options...
robtacular Posted April 26, 2021 Author Share Posted April 26, 2021 Okay, I found the answer. Browsed around the repo, so glad this is in TS. Updated my call to `lineStyle`: graphics.lineStyle(1, color, 1, 0.5, true); Thanks for the help! Also, I see that I linked to the wrong version of the docs, I neglected to check that when I followed a search result link. 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.