fengFanYong Posted June 1, 2017 Share Posted June 1, 2017 i create a pixi.graphics. how to set transform.worldTransform of graphics , Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 1, 2017 Share Posted June 1, 2017 Why do you need it? There's "transform.decompose(matrix)" method Quote Link to comment Share on other sites More sharing options...
fengFanYong Posted June 2, 2017 Author Share Posted June 2, 2017 because i want to set context.setTransform(1,1,1,1,0,0) of graphics Quote Link to comment Share on other sites More sharing options...
fengFanYong Posted June 5, 2017 Author Share Posted June 5, 2017 @ivan.popelyshev How to set context.setTransform(1,1,1,1,0,0) of graphics when render graphics? Thank! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 5, 2017 Share Posted June 5, 2017 ok, so we have "graphics.transform" which is actually a combined "graphics.position", "graphics.scale", "graphics.rotation" and so on. But you can set them from matrix directly. var matrix = new PIXI.Matrix(); matrix.set(1,1,1,1,0,0); graphics.transform.setFromMatrix(matrix); I DO NOT ADVICE TO USE (1,1,1,1), because that's actually a very bad matrix. Where did you take those parameters? Quote Link to comment Share on other sites More sharing options...
fengFanYong Posted June 7, 2017 Author Share Posted June 7, 2017 @ivan.popelyshev When i create a sprite,it children is graphics,but i hope this position of graphics is a Actual pixel。 var sp = new PIXI.Sprite(); sp.x = 100; sp.y = 100; sp.width = 100; sp.height = 100; var g = new PIXI.Graphics(); g.beginFill(0x123123); g.drawRect(0,0,100,100); g.endFill(); sp.addChild(g); i hope draw a circle 100*100 pixel. THANK! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 7, 2017 Share Posted June 7, 2017 if you have a circle with center (50,50), position of graphics is (100,100) and position of the parent sprite is (200, 200) , then, as a result, center will be shown at (350, 350). There's no way to change that in pixi: graphics coordinates are multilied by graphics matrix and then by parent sprite matrix. 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.