Author Topic: Button background doesn't change color  (Read 4616 times)

catacomber

  • Guest
Button background doesn't change color
« on: July 09, 2012, 11:20:27 PM »
Hi, I just started to use NGUI and am very impressed with it and excited about using it and have figured some things out but I have a problem changing the background of a button I made. Don't know what I'm doing wrong. Any help is appreciated.  I have a script on the button that changes scenes and it works fine. I'm making a game menu. But the background of my button remains gray, even though am trying to change the background to blue.  I tried to follow the video and changed what I think is the background but it doesn't show up. Don't know what am doing wrong.

catacomber

  • Guest
Re: Button background doesn't change color
« Reply #1 on: July 10, 2012, 01:18:32 AM »
OK, I've discovered that if I make a new UI and put a sliced sprite and then a button, the button background takes the color of my sliced sprite. : )

Progress. But now I'd like to have a picture on the background behind the buttons or a different color on the background behind the buttons.  Getting there I think..... how to do that?

I also don't understand why the video tutorial says I can click on the button and change its color when I can't do that. Any help sorting this would be much appreciated.
« Last Edit: July 10, 2012, 01:24:17 AM by catacomber »

catacomber

  • Guest
Re: Button background doesn't change color
« Reply #2 on: July 10, 2012, 02:01:42 AM »
OK, I started out with just a button and I could color the background. And then I added a tiled sprite and applied a paper sprite background and when I adjusted the z depth, my button appeared on top of the paper background and the background color was all right.

But I'm following the tutorials and I can't get a honeycomb sprite.  I just need to know if the tutorials I'm following are old and I just have to post here if I have a problem. I really would appreciate an answer as $95.00 for NGUI is not cheap.  Thanks.  I know  my questions are newbie questions, but newbies need help too.  :  ) Have to have the confidence that newbie questions however simple will still get help.




ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Button background doesn't change color
« Reply #3 on: July 10, 2012, 02:02:29 AM »
A button is made up of several NGUI components stitched together to get the expected behavior.

Select the button's background in the scene view, and just change its color. That controls the initial color.

Select the button game object and modify the color values of the UIButton script. These values control active, pressed, and disabled state colors.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Button background doesn't change color
« Reply #4 on: July 10, 2012, 02:03:16 AM »
Honeycomb sprite is a part of the SCIFI atlas. You aren't using it.

catacomber

  • Guest
Re: Button background doesn't change color
« Reply #5 on: July 10, 2012, 02:07:27 AM »
Thank you.  :  )  Still don't understand why when I put a Sliced Sprite first and a button on top of it, I couldn't change the background of the button---but perhaps this is all z order stuff.

Will get there.  :  )  Thank you for your help. I really like NGUI as am used to ios placing of things like buttons and it works similarly although not quite the same. It's a lot better than Unity Gui.  :  ) 

catacomber

  • Guest
Re: Button background doesn't change color
« Reply #6 on: July 10, 2012, 02:13:30 AM »
You have adopted a cat.  :  )