Jump to content

Render only on change


Recommended Posts

Hi all!

First - thanks for the great work on PIXI. But now to my question. Is it possible to render only when there are visible changes? So not 60 times a second. I'm currently hanging on to the interaction manager and listen to almost all mouse and touch events. I also monitor DisplayObject.alpha, Sprite.tint, Sprite._onTextureUpdate, Transform.updateTransform, Transform.updateLocalTransform, Transform.onChange as well as Text.updateText and Text.text. As soon as changes are made there, I set a flag so that I can manually call the render function. Is this correct, are there easier ways? Thank you in advance!

Link to comment
Share on other sites

Yes, its possible. We cant make it work like that in main repo, because it requires many hacks and serious support, but in particular projects - yes.

Maybe its easier to connect something like react fiber ;) 

Just in case, its better to make your own App class - https://github.com/pixijs/pixi.js/wiki/v5-Custom-Application-GameLoop , render() method should contain an "if"

It could be easy if every element had link to the stage, so you have to make it global or pass it down the tree somehow.

Edited by ivan.popelyshev
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...