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

Just started using Construct 2? Post your questions here

Post » Wed Oct 15, 2014 10:20 pm

Image

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-
B
6
S
2
G
1
Posts: 26
Reputation: 633

Post » Thu Oct 16, 2014 10:32 am

I have the same problem, you can go around it by set the tiled background height size in minus and re position it.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Thu Oct 16, 2014 5:53 pm

What the....?, holy crap it worked!
Thanks AONasser.
Now I'll have to remember that.

cheers,
james-
B
6
S
2
G
1
Posts: 26
Reputation: 633

Post » Sat Oct 18, 2014 7:58 pm

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.
B
9
S
1
Posts: 33
Reputation: 612

Post » Wed Oct 22, 2014 7:54 pm

Like Sesetenes said, Just a normal sprite is better than a tiled one.
B
4
Posts: 11
Reputation: 222

Post » Sat Oct 25, 2014 11:05 am

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

If you play Puyo Puyo games, you can meet me at the Puyo Puyo English Community Discord: https://discord.gg/0k41S8ARwvY2iTIQ
B
103
S
24
G
11
Posts: 697
Reputation: 12,898

Post » Mon Oct 27, 2014 12:24 pm

Tetriser wrote:@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.
B
9
S
1
Posts: 33
Reputation: 612

Post » Mon Oct 27, 2014 1:14 pm

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.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Tue Oct 28, 2014 12:04 am

Tiled background is very helpful in platform games.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Tue Oct 28, 2014 3:29 pm

Tetriser wrote:@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.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 3 guests