Can't get rid of gap that appears on image..

Get help using Construct 2

Post » Tue Apr 22, 2014 6:11 pm

Hi,

I'm having a small issue with applying a scrolling background to my game. I'm using the same method as the Autorunner template to create a scrolling background but the issue is that any image i insert (as a tiled background) seems to have a small gap when it scrolls back to the the beginning of the image.

The actual scrolling background seem to work fine, but its just this gap thats causing an issue.

It's not an issue with the image itself as i created the image myself and both sides match perfectly to create the effect of scolling continuously. I've tried increasing the size of the image but with no luck.

I'm not sure what the problem is so i hope someone can help.

I've included an image to show what i'm referring to.

Thanks
You do not have the required permissions to view the files attached to this post.
Image ImageImage
B
7
S
2
G
1
Posts: 94
Reputation: 1,245

Post » Tue Apr 22, 2014 7:43 pm

Project settings: point sampling, pixel rounding, letterbox integer scale.
Scirra Founder
B
402
S
238
G
89
Posts: 24,628
Reputation: 196,023

Post » Wed Apr 23, 2014 2:20 pm

Thanks for the reply but unfortunately that doesn't solve the problem, there's still a gap and also, because i've changed it to point sampling, the quality of my image decreases. Any other suggestions?
Image ImageImage
B
7
S
2
G
1
Posts: 94
Reputation: 1,245

Post » Wed Apr 23, 2014 2:40 pm

I know you said that it's not a problem with the image - does this also happen if you insert the image into a tiled background? What software did you use to create the seamless texture and did you resize the output to fit into your sprite? If you resized it then that line could be an artifact of the compression.
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,283
Reputation: 47,550

Post » Wed Apr 23, 2014 3:05 pm

I used Photoshop to create my images, these pictures definately match together to create a seamless image. These images that i'm having problems with are already inserted as Tiled Backgrounds. I did resize the images in Construct to make it slightly bigger to fit my layout size as they were a little smaller. But even if i resized the image in Photoshop to the exact size as my layout size and then insert it into Construct, it's still the same issue.

I have just noticed that the gap appears on the black line that shows the layout size, this is with all the images i'm having trouble with.

I've uploaded a couple of pictures to give a clearer view of what i mean.

The 1st picture i uploaded shows how it normally looks when i insert an image. In the 2nd picture, i've moved the image so you can see a gap that appears where the black line is in the 1st picture.

I've tried different things to solve this like increase the layout size, increase the image size but to no avail.
You do not have the required permissions to view the files attached to this post.
Image ImageImage
B
7
S
2
G
1
Posts: 94
Reputation: 1,245

Post » Wed Apr 23, 2014 3:12 pm

Resizing is the problem - it's compressing/stretching the image and creating the line. I am not familiar with Photoshp's capabilities for making seamless tiles, so I can't help there - but there are quite a few free programs available that will properly create seamless tiles of any size for you (quick google search and loads will appear).
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,283
Reputation: 47,550

Post » Wed Apr 23, 2014 10:19 pm

I don't understand how its a resizing issue, if its compressing/stretching the image, how does that make the gap appear? I downloaded a random image online and placed inserted it and the gap still appears. Is this some sort of bug? I don't get why this gap appears. Can anyone else offer any other suggestions? I cant be the only one that has experienced this issue....
Image ImageImage
B
7
S
2
G
1
Posts: 94
Reputation: 1,245

Post » Wed Apr 23, 2014 10:39 pm

Because when you resize an image the pixels are averaged according to the change in size / ratio and their neighbors influence the calculation - pixels at the edges don't have neighbors on one side... Create a sprite of, say 32x32 pixels and fill it with a pure color. Resize the image to 8x8 and see the compression effect on the edge pixels. I have no idea what random image you downloaded and so cannot comment....
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,283
Reputation: 47,550

Post » Thu Apr 24, 2014 3:36 pm

Never mind, i've solved the issue. I had a close look at the edges of my images in Construct, and after zooming in i noticed a small gap appearing on both sides of the image. After filling the gaps in with the color picker and brush tool, my issue was solved. Don't know why the gaps appeared but thanks to everyone that replied.
Image ImageImage
B
7
S
2
G
1
Posts: 94
Reputation: 1,245

Post » Thu May 22, 2014 7:20 pm

when you click the trim feature in C2 it ads a 1 pixel blank space around the image, which is not good for tile objects. ;)

-Mike Parent
B
49
S
9
G
4
Posts: 426
Reputation: 7,071


Return to How do I....?

Who is online

Users browsing this forum: WesleyDeveloper9 and 8 guests