Author Topic: ui2dsprite use packed image, it has blank border  (Read 2027 times)

神炫

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
ui2dsprite use packed image, it has blank border
« on: June 14, 2015, 08:05:45 AM »
First image is ui2dsprite,
second image is sprite editor

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ui2dsprite use packed image, it has blank border
« Reply #1 on: June 16, 2015, 12:38:49 PM »
NGUI adds 1 pixel of spacing to a sprite if its dimensions are not even. Ie: if your image has a height of 17 pixels, NGUI will add 1 pixel of padding to make it 18, thus dividable by two. Use a non-center pivot, and you won't need the sprite's dimensions to be dividable by two.

神炫

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Re: ui2dsprite use packed image, it has blank border
« Reply #2 on: June 17, 2015, 08:40:35 AM »
If the image packed from ngui, it's work fine. But if the image is multiple sprite mode, it has the problem.
If the sprite height is even, sprite is out of the scope of this widget.