dnbnina94

Infinte scrolling in Pixi.js

Recommended Posts

Hello friends,

I'm totally new to Pixi.js and canvas in general. I'm trying to develop my favorite board game Patchwork, where I have a scrollable container with patches from which player can select one. Above the canvas I have two buttons for controlling the scrolling direction. Each time player clicks on one of these buttons, the x coordinate of the container updates. 

I was wondering if there is any 'best practice' way to implement infinite scrolling of the container (such as creating an infinite image gallery)? I have a few ideas, but I wan't to hear other opinions before I really dive into implementing the solution to this problem. 

Here are some screenshots for reference:

Capture.thumb.PNG.9f6383c2c7fbae571c800555a8de72e3.PNG

Capture1.thumb.PNG.fa00fb2e6f74791120278765a11e3786.PNG

Thank you in advance!

Edited by dnbnina94

Share this post


Link to post
Share on other sites

I can't really think of a best practice for this really apart from only deleting/recreating sprites that you have to.

You probably have some idea where off-screen objects get moved on to the end of the stack, or get deleted then recreated... and either will probably be fine depending on the sprite count.

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...

  • Recently Browsing   0 members

    No registered users viewing this page.