Mathieu Anthoine Posted June 8, 2015 Share Posted June 8, 2015 Hi, After looking at PixiJs code, I guess that The worlTransform informations of DisplayObjects are updated only in the render, by calling the private method updateTransform(). In some cases, it's a bit boring. Here's a tricky situation I have in PixiJs v2: 1) I add a DisplayObjectContainer A to the stage and apply some transformations ( (scale, positions...)2) I create a DisplayObjectContainer B but don't added it to the stage3) I add a Sprite C in B4) I add B in A5) I call toGlobal on C --> wrong results on toGlobal (because the worlTransform of C has not been updated when B has been added in A (that means C is now added to the displayList, its stage is no longer null)) If I execute 4 before 3, it works fine, toGlobal returns right values. Sometimes I can't change my code (for example if I use pooling on DisplayObjects), is there a way to know when a DisplayObject is added to the displayList (when its stage property changes from null to the stage reference) ? Something similar to AS3 Event ADDED_TO_STAGE ? Is the behavior similar in Pixi v3 ? Thanks Quote Link to comment Share on other sites More sharing options...
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.