How do I get rid of a line on a tiled background?

0 favourites
  • 11 posts
From the Asset Store
Each tile 64 by 64 pixels - Ultimate Tile Set for your awesome games
  • Hopefully this image is registering but my problem is I get a thin line at the top of a tiled background image. This line is not in the original image. And the line does not appear if I add the same image as a sprite. Can anyone tell me why it's doing that and maybe how to fix it?

    thanks,

    James-

  • I have the same problem, you can go around it by set the tiled background height size in minus and re position it.

  • What the....?, holy crap it worked!

    Thanks AONasser.

    Now I'll have to remember that.

    cheers,

    james-

  • I've run into this problem as well. I just avoid using tiled backgrounds entirely. I just use a regular sprite and copy it as needed to tile (easy if you are using a snap-to grid layout). Or draw my backgrounds in their entirety in something like Photoshop and then slap them on a BG layer. Maybe using tiled backgrounds is more efficient, in terms of space and/or performance, but they seem a bit buggy to me.

  • Like Sesetenes said, Just a normal sprite is better than a tiled one.

  • Sestenes, xDevWizx - Does the method will gives negative effect to the performance (if you use too much tiles of sprites)?

  • Sestenes, xDevWizx - Does the method will gives negative effect to the performance (if you use too much tiles of sprites)?

    I doubt it affects performance much either way. For the most part, it's still just a single asset being repeated over and over.

    The way I do it is to go to View, and check Snap to Grid and Show Grid, and then set my Grid Width and Grid Height to half of the size of my tile. I choose half because otherwise the tiles will snap in to the center of the tile-section, and half of them will spill out of layout on the edges. If you choose half, then each of your tiles will cover a 2x2 grid of tiles, and you can line them up perfectly.

  • Yes,a bunch of sprites like that is horribly inefficient and should be avoided. There is no reason to avoid tiled backgrounds. Just move your source image up one pixel and it will solve it.that extra line is wrapped around from the bottom of the image. So don't move the tiled background up a pixel. Open up your source image and nudge it up one pixel.

    Otherwise, just reduce the height off that tiled background by one pixel to cut if the wrap-around.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Tiled background is very helpful in platform games.

  • Sestenes, xDevWizx - Does the method will gives negative effect to the performance (if you use too much tiles of sprites)?

    A rectangular tile background of 40x40 tiles will be rendered in one pass, and one single draw.

    40x40 sprites however will be rendered separately, which will increase the time needed to not only render them, but also to tell the GPU to start the draw, it is also an hassle to do it manually.

    C2's features, unless particular cases, should not be avoided in cases they are meant to be used.

  • I had the same problem and thanks to this post I found a solution. First you need to set the Heitgh value of the tiled backround to a negative value. Second, Your image must have a few empty pixels in the upper part, and then you need to set the height to a lower value, just for a few pixels, for example if your image has a total height of 512, then you must set it to -508 or something like that.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)