JosPixi Posted August 22, 2020 Share Posted August 22, 2020 Hi, I have created a shape with fill and line Then i cloned and if i want to edit the linestyle in PIXIV5. its not working. I referred this link https://www.html5gamedevs.com/topic/9374-change-the-style-of-line-that-is-already-drawn/ But i couldn't understand the issue in my case. Here is my code. independent_bet_shape = new PIXI.Graphics();independent_bet_shape.lineStyle(2, 0xFF00FF, 1) independent_bet_shape.beginFill(0xFFFFFF); independent_bet_shape.moveTo(138,-125) independent_bet_shape.lineTo(178,-125); independent_bet_shape.lineTo(178,-145); independent_bet_shape.lineTo(138,-145); independent_bet_shape.endFill(); independent_highlight_shape = independent_bet_shape.clone() independent_highlight_shape.x = independent_bet_shape.x independent_highlight_shape.y = independent_bet_shape.y Basically I need a working code, i understood the following points from other links. * that Geometrical properties r not cloned, * also we need to use dirty and clear dirty * but graphics.geometry.invalidate() is not needed in pixi 5. But the point is i dont complete with a working code. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 23, 2020 Share Posted August 23, 2020 clone() doesnt clone geometry, so if you want different style - sorry, you have to do it from scratch. https://github.com/pixijs/pixi.js/blob/8f7ed7662949ea1217b6f3b6af470e855cfe0b13/packages/graphics/src/Graphics.ts#L262 if it worked, then graphics.geometry.invalidate() could help you, and it exists only in pixi-v5. I advice is to read source of functions that you use, it provides much more information than you could read from posts. I usually open separate IDE window on pixijs project and use shortcut to search for particular class. JosPixi 1 Quote Link to comment Share on other sites More sharing options...
JosPixi Posted August 23, 2020 Author Share Posted August 23, 2020 Thank u, i already did from scratch. Happy to hear a reply from u. 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.