Author Topic: Sprite alpha trimming issue  (Read 2943 times)

Shorinji

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Sprite alpha trimming issue
« on: February 28, 2014, 11:09:19 AM »
Hi,

I have some sprites i made for a GUI which have some alpha round them. When I use the trimming feature of the atlas maker, the sprites are correctly trimmed inside the atlas.
However when i use them, the alpha around them is still present. I can see it because the handles around the sprites don't "stick" to the sprites, and the dimension of the sprite in the inspector are incorrect.

In the attached screenshot you can see that i have a sliced sprite. It's correctly trimmed in the atlas to 56 px width, but to get the correct width in the game i need to set the width to 72px, which is the original size of my sprite in Photoshop including the surrounding alpha. You can also see that the handles don't stick to the sprite.

Is it a bug or did i miss something here?

Edit : i attached the screenshot twice and i don't know how to remove it, sorry for that

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sprite alpha trimming issue
« Reply #1 on: February 28, 2014, 06:06:31 PM »
There is no alpha around them. When the atlas maker trims pixels, it replaces them with "padding", which simply pads the sprites so that their content aligns as if the trimmed pixels were still there.

If you don't like it, just clear the Padding fields when editing this sprite.

Shorinji

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: Sprite alpha trimming issue
« Reply #2 on: February 28, 2014, 11:03:55 PM »
Hi,
Thanks for your answer, the padding was the problem here, clearing these fields makes the sprites behave as i was expecting.