scrolling background iOS games

tiaf

  • Posts: 7
hi, i'm having a problem , i trying to make a endless game for iOS , and i have many frames for the background, but when i try to make it work, the background still allays on the first frame.
i try 2.0 and it still same problem, please need help
thanks

Dizko

  • *
  • Posts: 451
If you're using the built in background scrolling functionality, that doesn't work in iOS and it's a known issue.

zerosimms

  • Posts: 710
There is a download you can get from forge, just search "parallax scrolling", it's the one who's icon is a mountain.

On another note, repeated backgrounds do not work in IOS and parallax scrolling is a bit rubbish without repeating the background image. If anyone knows a way to repeat the background I'd be grateful to know.

Would pasting and lining up multiple background images take up to many resources?

FranAlt

  • Posts: 169
Hi! I just developed a solution and works perfect!

For example:
-My background is 2200x682
-When I create it (I place it manually in the scene) I set it to Always Active and with a certain X Speed (negative)
-Then I calculate what would its X be for it when the background will "end", that is to say 480px left on screen (iOS screen). My background is 2200px (1100px) 1100px-480px= 620px, so when X of Self= -620 create "Actor Type" (new the same actor) at 480.

So, when there is x480 left at screen automatically a "new background" will generate at x480

If you dont understand it this way just let me know that I will upload some images

Good luck!
Swipe - FREE          Cloud Run - FREE              
                                  
         iOS                                Android
    Android

alexrush

  • Posts: 19
Looks like it would work, but wouldn't having an always active background that large hugely affect performance?

FranAlt

  • Posts: 169
No, I'll have to check but I think Im still getting 60fps on an iPad. Its necessary to have it always active as the next background will be created outside the screen, otherwise it wont work. Another thing to take into consideration is to make it a "Sensor" or "NoCollision" object. You may disable some physics to gain performance.

Good luck!
Swipe - FREE          Cloud Run - FREE              
                                  
         iOS                                Android
    Android

Caroline

  • Posts: 2
Please could you upload pictures, I'm struggling to understand what you mean and I'm having this exact problem.
Thank you in advance :)

skippertech

  • Posts: 256
I am basically trying to pull of the same thing...