Jump to content

set graphics transform.worldTransform


Recommended Posts

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();


I DO NOT ADVICE TO USE (1,1,1,1), because that's actually a very bad matrix. Where did you take those parameters?

Link to comment
Share on other sites


 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();

 i hope draw a circle 100*100 pixel.


Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...