Access to the game loop
Closed this issue · 1 comments
lgraziani2712 commented
Is it possible to access to the game loop? With a hook, for example. I want to add movement to a Sprite, but as I learned with https://github.com/kittykatattack/learningPixi#keyboard-movement, I need to add the velocity movement to the loop.
Thank you.
Izzimach commented
react-pixi doesn't really have a game loop, it just does the render part. You can make your own game loop with requestAnimationFrame
and then call ReactPIXI.render
every frame to re-draw. The interactive example does that here but you can also put your game loop outside of the React components as well.