Pixi.js added an onRender callback that is called every frame in v8, however ReactPixi seems to only have support for Pixi.js v7, so I have to use updateTransform. (I’m using ReactPixi). The documentation below states about updateTransform – “many people used this function to do custom logic every frame”
https://pixijs.com/8.x/guides/migrations/v8?_highlight=onrender#other-breaking-changes
Also, how do I actually use updateTransform? (what arguments does it take, what does it do, etc..) I couldn’t find any documentation on it,
except this which doesnt explain anything… https://pixijs.download/v4.8.9/docs/PIXI.TransformBase.html#updateTransform
The tricky thing is – I don’t actually want my sprite to move every frame… I’m really just looking for a callback to do something ELSE every frame, and I noticed that updateTransform moves my sprite even if I dont pass it any arguments. Is there a different callback I should use? Also, is it possible to use updateTransform without it moving my sprite?
Thanks!
I tried this but arg was undefined and I have no idea how to use the method… thanks!
<Sprite
image={"../images/blue.png"}
width={100}
height={100}
x={100}
y={100}
anchor={0.5}
interactive={true}
pointerdown={onDragStart}
pointerup={onDragEnd}
pointerupoutside={onDragEnd}
pointermove={onDragMove}
rightdown={right}
rightdowncapture={right2}
updateTransform={(arg) => {
console.log(arg)
}}
/>