Anonymous1994 Posted June 3 Share Posted June 3 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) }} /> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.