Chromical Posted March 25, 2021 Share Posted March 25, 2021 I'm trying to draw borders around objects, currently sprites for best performance. Nothing too fancy, just some rectangular one colored sprites. Currently I'm trying to have two extra containers with unfilled rects, the size of the sprites for the borders (two containers, because there's borders that have priority over the regular borders, in case they overlap), which works fine until I start to zoom, then borders naturally get thicker, the further I zoom in. I already found this thread, which seems to be the solution for my problem: But I can't access the myGraphicsObject.geometry.graphicsData in TypeScript. .geometry exists, but .graphicsData does not. Have there been any changes to the object structure? We're currently on 6.0.1 and the thread seems to be covering version 5 and earlier. Or is there a better solution to having a border that's always 1px on screen, independent of the zoom factor? Thanks a lot Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 25, 2021 Share Posted March 25, 2021 > But I can't access the myGraphicsObject.geometry.graphicsData in TypeScript "as any" solves everything. If you see that typings lack something - make an issue or PR to pixijs github repo > is there a better solution to having a border that's always 1px on screen, independent of the zoom factor? if its smoothed - special shaders is better solutions but its hard and nobody implemented Graphics fully with it if its just 1px aliased - nativeLine, there's a param in pixi LineStyle Quote Link to comment Share on other sites More sharing options...
Chromical Posted March 26, 2021 Author Share Posted March 26, 2021 Yes, any did the trick I opened an issue for that. Thanks again. 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.