digitalml Posted January 21, 2017 Share Posted January 21, 2017 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 Quote Link to comment Share on other sites More sharing options...
iggyZiggy Posted January 21, 2017 Share Posted January 21, 2017 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. 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.