9-patch: seams visible even when "Exact" selected

Bugs will be moved here once resolved.

Post » Tue Jul 09, 2013 12:34 am

Link to .capx file (required!):
http://snugsound.com/dev/c2-9-patch-wrapping/9-patch-wrapping.capx

Steps to reproduce:
1. Create a 9-patch object using attached image (Source-image.png); set all margins to 16, "Edges" and "Fill" to "Tile" and "Seams" to "Exact"
2. Add a few instances to a new layout
3. Run the project

Source image:


Source image (to show 16px grid, and transparency):


Observed result:
Some blocks have visible seams



Expected result:
No seams should be visible since "Exact" was specified

Browsers affected:
Chrome: yes
Firefox: yes
Internet Explorer: N/A (not targeting IE)

Operating system & service pack:
Windows 7 SP1 32-bit

Construct 2 version:
C2 R132 32-bit
B
8
S
3
G
2
Posts: 5
Reputation: 1,902

Post » Tue Jul 09, 2013 9:25 am

Closing, this is the top row of pixels wrapping back down to the bottom. Add a row of transparent pixels to the top of the image.
Scirra Founder
B
386
S
229
G
87
Posts: 24,207
Reputation: 191,602

Post » Fri Jul 12, 2013 2:10 am

Can you elaborate? From my perspective there should be nothing below the bottom "margin" area. Why is it wrapping? Only the "tiled" area (the middle 16, in the zoomed-in image above) should be wrapping, unless I'm misunderstanding the intended behaviour of the 9-patch?

Adding a row of transparent pixels is fine for scenery, but for objects with the "Solid" behaviour it then results in a gap for floor collisions, since there are no collisions masks for 9-patches.
B
8
S
3
G
2
Posts: 5
Reputation: 1,902

Post » Fri Jul 12, 2013 11:38 am

'Letterbox scale' allows floating-point scaling, which means sub-pixel rendering can occur. Sub-pixel rendering at the bottom of a tiled image means the top of the image wraps back again, as if the image was repeating again below. To avoid that, either use a row of transparent pixels at the top, or set point sampling, pixel rounding and letterbox integer scale to ensure sub-pixel rendering never happens.
Scirra Founder
B
386
S
229
G
87
Posts: 24,207
Reputation: 191,602

Post » Fri Jul 12, 2013 4:17 pm

Thanks for clarifying
B
8
S
3
G
2
Posts: 5
Reputation: 1,902


Return to Closed bugs

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest