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
. 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
How can I access the sprite object from within updateTransform? I would assume its the argument of the callback, but doing console.log(sprite) gives undefined…
Also, why does updateTransform move my sprite on the screen?
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={(sprite) => {
console.log(sprite)
}}
/>
Sprinkle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.