Author Topic: How do I get rid of borders on a button?  (Read 2990 times)

bigsiegee

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
How do I get rid of borders on a button?
« on: July 17, 2014, 10:02:59 AM »
Solution:

The white outline that is appearing is the box collider. It doesn't really have anything to do with the sprite persay. To make the box collider invisible I went to Game Panel: Gizmos and turned off 2D/3D box colliders. Works a charm now. Basically a completely transparent button overlaying a map that turns that part of the map/button grey when you hover over it with nothing suggesting there might be a button there.

I am trying to make a 'Where's Wally' type button so you have to hunt around a 'map' until you find 'the button/wally'. Right now the button works fine-ish. It is hidden except for a small white border around the entire button. Finding Wally isn't any fun if there is a white border around him? Anyone able to help out in regards to how I get rid of this small white outline?

Thanks heaps.

Adam.
« Last Edit: July 18, 2014, 11:14:02 PM by bigsiegee »

Arcio

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 10
    • View Profile
Re: How do I get rid of borders on a button?
« Reply #1 on: July 17, 2014, 02:16:55 PM »
When you brought in your image, in NGUI did you click on the button "add a soft outline"? If so, you need to delete the image and re-import it. If not, first select your sprite, then click on the atlas that contains the sprite. Under "Sprite Details" set the border to 0.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How do I get rid of borders on a button?
« Reply #2 on: July 18, 2014, 04:55:58 AM »
This isn't an NGUI question, but a Unity question. Select the offending texture (source texture, not NGUI sprite) and check the Alpha is Transparency checkbox, then re-add the sprite to the atlas. If that doesn't work, then examine the actual source texture. PNG image format uses pure white color everywhere where you see a transparent pixel. This is why you should be working with alpha, not transparency. Use TGA format.