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

0 favourites
  • 5 posts
From the Asset Store
A set of retro 16-Bit Neon UI elements to make your menus pop!
  • Link to .capx file (required!):

    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:

    <img src="http://snugsound.com/dev/c2-9-patch-wrapping/Source-image.PNG" border="0" />

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

    <img src="http://snugsound.com/dev/c2-9-patch-wrapping/Source-image-with-16px-grid.PNG" border="0" />

    Observed result:

    Some blocks have visible seams

    <img src="http://snugsound.com/dev/c2-9-patch-wrapping/9-patch-wrapping.PNG" border="0" />

    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

  • 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.

  • 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.

  • '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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for clarifying

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