making a seamless scrolling background
digitalzero
Member, BASIC Posts: 639
i thought i knew how to do this with the whole scene wrap thing but im getting gaps... i remember reading about this WAY earlier when i first started gamesalad but either im tripping or something just plain aint working theres a big gap -_-... my image is 1083... can i get some help from you lovely people???
Comments
https://www.dropbox.com/sh/lr6r2o8edf7am8c/cY0seHWKn3
It´s that what you looking for?
Hope that helps. You'll need to adjust the values for your image size, obviously.
I did have some code I was using in the Unity version which is similar but I changed to scrolling textures, not two objects... I'll see if I can find the original formula, that should help...
transform.localPosition.x += (fRightPosition * 2)-(fLeftPosition * 2);
So basically, when the screen hits the left position set it to the current position + ((right position * 2) - (left position * 2))
Obviously the left and right positions will depend on the size of the display/graphic file dimensions etc.
when self.position.x == left position,
self.position.x = self.position.x + ((right position * 2) - (left position * 2))
Hope this helps
EDIT: I haven't tried this in GS... hope it works...
https://www.dropbox.com/sh/lr6r2o8edf7am8c/cY0seHWKn3?m
(Only change the game.scrollspeed attribute to control the speed of the scrolling)
Edit: You maybe have to change a little bit in the rule to make your picture that is 1083 width. (Say if you need help with that to)