patrickfabrizius Posted January 20, 2017 Share Posted January 20, 2017 Hi! Is there a way to know when a container is fully rendered? I often trigger animations after setting up a view (container with sprites, text, rects etc) but on slower computers the animations are sometimes half-way done before the actual view is rendered. I use PIXI.loader with a progress that waits for all assets to load, so everything should be in memory. Not sure if the delay is because some textures are not fully stored in memory or if it's the actual rendering of sprites. I have looked at container.renderable, container.worldVisible, sprite.texture.baseTexture.isLoading / hasLoaded, but they are no different right after initializing my view from a couple of seconds later. What I'm basically looking for is a container.isRendered, or a sprite.isRendered so I can iterate thru them and call an event telling my game the view is fully rendered? I've noticed that the main thread is often hogged (requestAnimationFrame) for 100-1000 ms after initializing the view, I guess I could use the first requestAnimationFrame after init but that seems unreliable. Anyone else with the same problem and/or a smut solution? 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.