9-Patch corners are overlapping by 1 pixel

  • Link to .capx file (required!):

    dl.dropbox.com/u/2175584/Construct2Examples/9SlicePatchBug.capx

    Steps to reproduce:

    1. Use a 9-Patch

    2. To observer best use some transparency

    Observed result:

    Where the corners meet the sides (which can either tiled or stretched) they overlap by one pixel. Subtle but more noticeable on semi-transparent textures.

    <img src="https://dl.dropbox.com/u/2175584/Construct2Examples/9SlicePatchBug.jpg" border="0" />

    Expected result:

    Hopefully you can just make them meet up exactly without overlapping.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes (even worse)

    Operating system & service pack:

    Windows 8

    Construct 2 version:

    r119 (64-bit)

  • This is actually by design. If the edges meet exactly, it can show seams when scrolling and scaling due to the way rendering at sub-pixel offsets works. I think that's a much more common case than semitransparent images.

    Can you work around this by putting the objects on their own layer and setting that layer's opacity, or do you think there needs to be a setting for this?

  • Ideally a setting (for example "exact match" or "overlap").

    Can you make these objects always snap to whole pixels to avoid the scrolling/scaling issue?

    Also I am using Pixel Rounding, so I assume I wont see seams?

    Reason I would ask for the option is because with my current art style I only[b/] want the edges of the boxes to look like glass and for the inside of the grey buttons to look like glass too. I use transparency to achieve this effect (specially when animating this over my assets) but I guess if I can't use 9Patch I can just make all the assets at the pre-set size.

    By the way the 9Patch objects render fine in the editor, just not at runtime, is that because at runtime you change the positions?

    Thanks for the quick response

  • I had this issue as well when the 9-Patch was released and I wanted to try it

    Same thing with an image for an UI with opaque background and semi-transparent outline

    I'm not using pixel rounding in this project, but a setting would be nice anyway I think, when relevant

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Pixel rounding doesn't solve everything - if you scale the view slightly it can still seam. I'll see if I can add an option for this.

  • Added a setting for this for the next build. Should be fixed then.

  • Sweet :) Thank you, can we expect it soon. Want a badge for one of the first few to download it :)

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