Jump to content

rendering only when needed


Recommended Posts

hi all,


I've started using Phaser instead of Pixi because it seems it has a lot more possibilities.

but where in Pixi I managed to find when to render the view whenever I want to (it's not a game I'm creating, but an app with graphics and I need it to bee real smooth) via the renderer.render(stage) method, I can't really find how to do the same in Phaser.

I've seen that there is a lockRender property, and it seems to block auto rendering, but I've not yet managed to render manually after that.

any ideas ?





Link to comment
Share on other sites

21 hours ago, MikeW said:

Made the same switch. I just let it render without overriding it. Have not had performance issues but don't have alot of sprites see how it goes without a separate render function. 

Ill try that as well, but I'm a bit afraid of my app running on small company computers.


15 hours ago, samme said:

The idea is you lock rendering when it's unneeded and then unlock it each time you need a render update.

If you want to really do your own rendering you can call Phaser.RequestAnimationFrame#stop and run your own RAF.

thanks !

can't get to make it work though...

I tried to declare it like this, since that's what's lightly explained in the doc

raf = Phaser.RequestAnimationFrame(game)

these methods don't work because raf is undefined...


I'm beginning with all of this, so I'm missing something.

do I have to declare a resuqestanimationframe function ?

but the main purpose of this is to "just render" at any given time...

Link to comment
Share on other sites


  • Recently Browsing   0 members

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