Author Topic: Transparency When Creating A 9-Slice Sprite?  (Read 4602 times)

r-dotPhunky

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Transparency When Creating A 9-Slice Sprite?
« on: January 03, 2013, 11:54:28 AM »
Hi all,

I'm a little stuck and could use a bit of help/advice.  I purchased the NGUI software yesterday - I am loving how easy it was to setup a simple gui for my little game.

So in looking at the "Fantasy" Atlas, I saw how the 9-slice sprites worked.  I wanted to go and create my own, which I've attached as a PNG file. I am using PSD in the project per this post: http://www.tasharen.com/forum/index.php?topic=974.msg4960#msg4960

but I could not attach a PSD file.

I left 3 pixels empty around the edges of my sprite, but when I import it into Unity and add it to the atlas, the border that I left is gone.  Could anyone possibly enlighten me as to what I've done wrong?  I'm guessing it's a simple thing and I'm just dense.  Any help would be greatly appreciated!

Thank you!

dlewis

  • Guest
Re: Transparency When Creating A 9-Slice Sprite?
« Reply #1 on: January 03, 2013, 05:48:40 PM »
I left 3 pixels empty around the edges of my sprite, but when I import it into Unity and add it to the atlas, the border that I left is gone.  Could anyone possibly enlighten me as to what I've done wrong?  I'm guessing it's a simple thing and I'm just dense.  Any help would be greatly appreciated!

Thank you!

In the atlas maker there is a 'trim alpha' option. Turn that off and the alpha border will be preserved.

nah0y

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 430
  • \o/
    • View Profile
Re: Transparency When Creating A 9-Slice Sprite?
« Reply #2 on: January 07, 2013, 12:29:47 PM »
Or just live without the borders and position your sliced sprite at x+3 and y+3 :)