Oyed Posted May 22, 2015 Share Posted May 22, 2015 I'm working with multi-leveled containers and I'd like to know if the position of the sprite(s) inside a container is relative to the containers position? For example;var container1 = new PIXI.ParticleContainer(), container2 = new PIXI.ParticleContainer(), mySprite = new PIXI.Sprite(someTexture);mySprite.x = 10;mySprite.y = 15;container1.addChild(mySprite);container1.x = 50;container1.y = 100;container2.addChild(container1);Would "mySprite"s X and Y be rendered as 60,115 - or are the co-ordinates not relative to the container and will be rendered at 10,15? Thanks! Quote Link to comment Share on other sites More sharing options...
Oyed Posted May 22, 2015 Author Share Posted May 22, 2015 Further testing led me to answer my own question (Should have done so before hand - sorry!) For those who're wondering, the answer is yes, it is relative. Quote Link to comment Share on other sites More sharing options...
xerver Posted May 22, 2015 Share Posted May 22, 2015 Yes Pixi is a scene graph, each node has a local transform and a world transform. The world transform takes into account the local and all parent transform properties (position, rotation, scale). The same goes for alpha 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.