Author Topic: strange sprites artefacts at the borders  (Read 1905 times)

Nubeh

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 41
    • View Profile
strange sprites artefacts at the borders
« on: August 26, 2014, 09:16:00 AM »
I'm experiencing some weird issues with some of my sprites. I have all of them packed in an atlas and every single image is set to Texture with Alpha is Transparency. It happens that some of the sprites when used in a view have some thin lines around the border. It's strange because it happens only with some of the sprites. I tried to add some transparent border to such sprites and then setting the border in the sprite editor to 2px but it doesn't change. The effect is also very inconsistent, sometimes only some instances of the sprite have artefacts, sometimes the artefacts are only visible when deployed on device but maybe they are visible on an iPhone but not Android. Any idea what the reason could be? Thank you.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: strange sprites artefacts at the borders
« Reply #1 on: August 27, 2014, 04:11:35 AM »
When creating/editing your atlas you get to specify padding in pixels. This padding applies to all sprites whenever you make any change to the atlas, such as updating a sprite. If you choose 0 pixels, then there will be no padding, and you will have edges of other sprites bleeding through. Leave this value at 1 or even higher if you don't use sprites at their native dimensions.

Nubeh

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 41
    • View Profile
Re: strange sprites artefacts at the borders
« Reply #2 on: August 27, 2014, 04:46:16 AM »
oh, I had it set to 2px but now I set it to 5px and it seems to work. Thanks!