Hello Guest

Author Topic: Why my sprite has grey border?  (Read 6347 times)

tracyma

  • Newbie
  • *
  • Posts: 4
    • View Profile
Why my sprite has grey border?
« on: July 22, 2013, 08:23:55 am »

How to deal with it, i'm new here.

TIA!
« Last Edit: July 22, 2013, 12:38:33 pm by tracyma »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Why my sprite has grey border?
« Reply #1 on: July 22, 2013, 10:56:43 am »
The cause is likely bad source images.
Switch to premultiplied alpha and try it - switch in sprite collection settings & commit. Then select the atlas material and switch shader -> tk2d/PremulVertexColor.

tracyma

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Why my sprite has grey border?
« Reply #2 on: July 22, 2013, 11:31:05 am »

How to do the switch, I did not find the option, can u show me step by step?
« Last Edit: July 22, 2013, 12:37:23 pm by tracyma »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Why my sprite has grey border?
« Reply #3 on: July 22, 2013, 11:35:27 am »
Open up sprite collection editor. Click Settings. Tick premultiplied alpha and commit.
Select the sprite collection material, switch the shader to tk2d/PremulVertexColor.

tracyma

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Why my sprite has grey border?
« Reply #4 on: July 22, 2013, 12:20:42 pm »
I did, but the same.
And there're some sprite overturn in atlas, Why?
« Last Edit: July 22, 2013, 12:34:18 pm by tracyma »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Why my sprite has grey border?
« Reply #5 on: July 22, 2013, 12:27:17 pm »
I can't see your images, btw. I couldn't see the first images either.
Try uploading to a different site or attach to the forum.

The sprites rotated in the atlas are normal. Thats how the tk2d packs the images in there.

tracyma

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Why my sprite has grey border?
« Reply #6 on: July 22, 2013, 12:36:16 pm »
Image link was updated. Some sprite was reflected, not just rotated.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Why my sprite has grey border?
« Reply #7 on: July 22, 2013, 12:55:32 pm »
Its rotated and flipped - thats how it stores the data in the atlas, its normal. Its corrected when drawn on screen, so you don't have to care about that.

With your error - why is the image stretched in your screenshot? Does it look better when you draw it pixel perfect? Also try setting it to point filtered, is it better then?

Can you create a simple repro case for me with this? You can blank out all the non-relevant textures if you want. support at unikronsoftware dot com if you can do that.