Jump to content

Parallax Scroller Background Help


digitalml
 Share

Recommended Posts

I'm creating a parallax scroller and currently have 3 sprite sheets (3 json files) that contain the assets for my scrollable background.  I'm able to load them up and what I've done is throw each texture into a sprite (they are large 1920x1080) add those sprites to a container and then I scroll the container. from left to right using a tween to get my scrolling motion. I then added a second container with exact the same sprites and simply swap each one behind each others x + width once one has gone off screen for an endless scrollable background effect. This seems to be working just fine but I am concerned about the performance of so many large sprites.  I'm just checking to see if this is the best way? I've tried using a RenderTexture instead of two containers filled with loaded sprites to save memory but because of the size of the textures this didn't work.  I also tried using a TileMap but as I understand it can only tile one texture and not multiple?  Thoughts?  Suggestions?  Please let me know.

Thanks
DML

Link to comment
Share on other sites

I'm doing the same thing, no issues with performance so far. And I'm using multiple scrolling layers for far, mid and close.
As for RenderTexture, i think that's best if you have to render tons of sprites on stage which you won't need anymore, for example blood, corpses, bullet holes, etc. Situations when you pretty much don't need anything from that sprite anymore, but for scrolling background that sounds like too much work for little gain if any at all.

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...