seamless background problem

sheeposheepo Member Posts: 9
edited February 2012 in Working with GS (Mac)
Hello! I'm making an iphone game where a character is endlessly running. I am achieving this by having still actors but moving obstacles and an endlessly wrapping background. To do this I am having 2 different background images (1 on top and 1 on the bottom, they are also being used as the slide n jump controls) that are constantly moving left and having the scene wrap x. When you preview it in GameSalad, it works exactly as it should; however, when you preview on a device, it stops working. It scrolls but I get a line where it just shows the scene background color instead of the background image. Its hard to describe, here's an image:
http://i.imgur.com/x2DPB.jpg

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    @sheepo .. can you upload just the image with the buildings in it? I sense that your image may have something bordering it as what you show is unusual. Sometimes images will show a line between them but usually only on one axis so this is strange. If I can see just the individual image I can might be able to determine the cause. (On the issue that I mentioned GS sometimes doesn't match up images perfectly on one axis when they are moving so others have suggested making them overlap a pixel or two as the solution)
  • sheeposheepo Member Posts: 9
    edited February 2012
    As I mentioned it is 2 images put together which is why there is one on the x axis too. It is because I'm also using them as tap controls. I also tried your solution (making the image a bit bigger) and that doesn't work. Also, the color is actually different from the background color. im stumped.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    @sheepo - I had this problem for ages before I realised how to fix it. Increase the width and/or height of the background actor by 1pixel. That extra pixel will cover up the gap that sometimes appears.

    To clarify, I mean change the size in GS but leave your imported png image the same.
  • sheeposheepo Member Posts: 9
    @honeytribestudios that worked for the x axis (the one which isn't moving) but I'm still having the problem with the wrapped moving left one, it just appears in a different spot now.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    Looking at your screen shot it seems like the bottom half of the screen has 2 background images. And they scroll from right to left. But a gap appears between them. Is that right?

    So to get rid of the gap, increase the width (don't change the x position) of one of those two images. I'd increase the left image and have that under the right image in the layer oder.
  • sheeposheepo Member Posts: 9
    It doesn't have 2 images width wise though. It has a top one and a bottom one. I have no idea why its making this gap.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    Does your image have any transparency in it? I read in another post that there is some strange bug that causes the gap. And having at least 1 pixel of transparency in the image may help.

    All my background images already have transparent areas so I just added the extra pixel and then it scrolled without gaps.
  • sheeposheepo Member Posts: 9
    nope no transparency and it still doesnt work.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    It's hard to say what the problem is without seeing your project. If you want to post it here or email it to me I might get a better idea.
  • sheeposheepo Member Posts: 9
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    edited February 2012
    I just tested on a 3rd gen ipod using the viewer. It scrolls fine with no gaps.

    You have the width of 'slide' set to 484. It works fine at 484, 481 or 480

    Edit: I'm using GS 0.9.9.1
  • sheeposheepo Member Posts: 9
    edited February 2012
    that's really weird. I'm on an iphone 4 and I tried it. Its still there but its hard to see.
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    You are using non retina sized images on a retina sized device. So your 480x320 sized images are being auto stretched when on the iphone 4 which has a rez of 960x640

    Go you back to your image software and double the size of all your images. Then import those into your project. Tick 'resolution independence' on the project info tab of the home page.

    I reckon that will fix it.
  • sheeposheepo Member Posts: 9
    edited February 2012
    O.K, that fixed the background thank u soooo much! It made the characters bigger so can't see all of them but I can work around that!
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    Glad it's working. To clarify, when using 'resolution independence' you don't need to change any sizes in GS. Only the png images you import. Make them exactly double the width and double the height compared to how you had them originally. Then everything should be the same size in the game as you had in the original.
Sign In or Register to comment.