HauntedSmores

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. Thanks to both of you guys, @jinzo7 and @ivan.popelyshev! The answer I was getting at was that, yes - the renderer is rerendered appropriately at 60fps internally by PIXI.Application in v4 as opposed to older implementations where I had remembered needing to call that yourself. Here's what I've got going as a demo with new v4 syntax: https://codesandbox.io/s/yw2vox5479?module=%2Fsrc%2Fcomponents%2FCanvas.vue (Just click around) Maybe you can tell me if this follows general best practices. Again, thanks for the helpful answers!
  2. It seems like if you simply update a sprite or primitives properties directly, either with setTimeout or requestAnimationFrame or some other tweening library, the objects will move. Is this new with using PIXI.Application? Older docs or forum posts show needing to rerender the stage constantly. I would just expect simply moving the properties by just changing x, y, scale, etc. wouldnt work but it does.
  3. Hey everyone, So Im new to game development, although Im a full stack JS dev for general sites and apps. I started getting into canvas animation and now Im here trying to learn some game animation stuff. My question is this: Do you generally do just about all animation in the game loop with requestAnimationFrame()? Or can you simply have renderer.render(stage) called in the game loop while outside of it you use GSAP or some other tweening mechanic to change the positioning props on objects/sprites? Iv tried it and it works, I just would like to know if its dumb or nonperformant. I also tried using my regular js tweening library to call `renderer.render(stage);` in its update callback and it looks the same (im just doing a simple animation generating snow-like particles that float down). I know that the supported game loop in PIXI has stuff for velocity and whatever but I really like my animation library's (http://animejs.com/) easing and elasticity options. Will calling renderer.render(stage) in the game loop while tweening outside the loop still be 60FPS? Or do I need to be updating in the game loop? If I have to do it in the game loop, does anyone have any tips/references for easing and all of that? Because I dont want to have to write my own easing functions to update in the game loop (and I suspect most people arent), and rather use an animation API for that. Im also brand new to PIXI and maybe it has its own easing and whatever that works inside the game loop. Cheers