MattN Posted June 12, 2022 Share Posted June 12, 2022 Hi folks, I'm currently trying to make a ball bounce around the screen. I've done this before in C++/SFML, bog-standard html canvas and in ThreeJs, so now it's Pixi's turn! What I'd usually do: Make a circle object Fill it with an image; it's fitted, so it'll resize as the circle does Do the maths to make the circle move and bounce around The problem is, I'm struggling to understand how to pull it together in Pixi: I can make a sprite which takes on the size of the image This can be scaled, and have its width and height set I can make a PIXI.Graphics in the shape of a circle, or I can make a PIXI.Circle (which is what I expect I need) BUT: I cannot fill the graphics/circle with the sprite, making the image fit the circle It seems like the image and the circle object are to be kept separate, which seems a bit alien to me. How can I garuantee the graphics/cirlce object matches the shape of the image exactly, and visa versa? I've seen this, https://codepen.io/ccorder2/pen/NyvygQ but that doesn't cover the image part. What am I missing here? Help appreciated, thanks all! Quote Link to comment Share on other sites More sharing options...
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.