Sign in to follow this  
Hi Im Sev

Keeping track of every sprite position in a tiling sprite

Recommended Posts

I made a container containing a bunch of sprites. Then I made a single texture out of it and made a tiling sprite. Now my question is, is it possible to still keep track of the positions of the sprites that are now in the tiling sprite? Because I need to animate the tiling sprite and still keep track of the position of the sprite. 

Share this post


Link to post
Share on other sites

Can you be more specific on how its done like just console logging the positions per sprite would be greatly appreciated. Here is a part of what I've been doing...

const reelTexture = app.renderer.generateTexture(container);
let newReel = new PIXI.TilingSprite(
reelTexture,
reelTexture.width,
reelTexture.height
);
 
app.stage.addChild(newReel);
let reelSpeed = 0.3;
animate();
function animate() {
newReel.tilePosition.y += 10;
app.renderer.render(app.stage);
requestAnimationFrame(animate);
}

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.