djo Posted April 25, 2017 Share Posted April 25, 2017 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 ? thanks, djo Link to comment Share on other sites More sharing options...
MikeW Posted April 25, 2017 Share Posted April 25, 2017 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. Link to comment Share on other sites More sharing options...
samme Posted April 25, 2017 Share Posted April 25, 2017 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. Link to comment Share on other sites More sharing options...
djo Posted April 26, 2017 Author Share Posted April 26, 2017 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) raf.updateRAF() raf.start() 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 More sharing options...
djo Posted April 26, 2017 Author Share Posted April 26, 2017 ok I switched to Phaser.CANVAS and it's waaaaay smoother. maybe I won't need the custom renderer after all. Link to comment Share on other sites More sharing options...
Recommended Posts