Gap in Repeating Background on iPhone 5s
jshbbe
Member Posts: 2
I've looked all over the place, and tried every suggestion out there, but I cannot seem to fix the issue I'm having. Every time I try to create a repeating background that's endlessly scrolling it gives me a gap about a pixel or so wide. This only appears on my iPhone 5s, and not the previewer.
My method for creating a repeating background is as follows. I have two copies of the background scrolling across the screen. Once one copy goes off the end, then I change its X value to go behind the other copy. I've tried all of the following to no avail:
1. I've tried overlapping each copy. - Still a gap
2. I've tried using PNG and JPG. - Both cause a gap
3. I've tried changing the velocity to a slower speed. - Still a gap
4. I've tried changing my scene's background color to match. - Still a gap
This seems like something that many people would use, so I'm sure there has to be some way to get this working without that gap. Any suggestions?
My method for creating a repeating background is as follows. I have two copies of the background scrolling across the screen. Once one copy goes off the end, then I change its X value to go behind the other copy. I've tried all of the following to no avail:
1. I've tried overlapping each copy. - Still a gap
2. I've tried using PNG and JPG. - Both cause a gap
3. I've tried changing the velocity to a slower speed. - Still a gap
4. I've tried changing my scene's background color to match. - Still a gap
This seems like something that many people would use, so I'm sure there has to be some way to get this working without that gap. Any suggestions?
Comments
I noticed that if I overlapped the backgrounds, and if the trailing background was in a layer above the leading background, then the gap didn't occur. Only problem was when I moved the leading background to be the trailing background. So now the new leading background becomes the higher layer. This is when a gap occurred, no matter if it was overlapping.
So I realized the trailing background had to always be the upper layer, and since GameSalad doesn't allow you to modify an actors layer through behaviors, I had to work around this. I had to tell the leading actor to destroy itself when off the screen, and I told the trailing actor to spawn a new actor above and trailing itself.
TL;DR - Trailing background always need to be in a higher layer than the leading background.
I know this might be confusing, but I am at a loss of how to better explain it. It's too bad this is even an issue.
Then, the gap will be gone.