Author Topic: Problem Toggle Checkmark with alpha value  (Read 6515 times)

Darkmax

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 93
    • View Profile
Problem Toggle Checkmark with alpha value
« on: February 04, 2014, 03:18:24 PM »
Hi was trying to implement a file browser in ngui for my app, and I list all the files and directories using the prefab toggle and using it like radio buttons, so when I click on a file this is highlighted (the checkmark is the sprite that highlights the item), so I setup my checkmark with an alpha value of 90 (0-255) on the sprite color. The problem is when I hit play and I click on file checkmark always its show with alpha 255 value and doesn't respect the value that I put on the sprite alpha value on my setup.

How can I solve this?

Thanks in Advance.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem Toggle Checkmark with alpha value
« Reply #1 on: February 05, 2014, 04:40:19 PM »
Unity's Color type uses floats in 0 to 1 range, not 0 to 255.

Darkmax

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 93
    • View Profile
Re: Problem Toggle Checkmark with alpha value
« Reply #2 on: February 05, 2014, 11:52:12 PM »
mm the color picker of unity is from 0-255 on rgba, I check the UIToggle I think the problem are the lines where the alpha is set to 1f no matter of the alpha that I set on the color picker on the check mark sprite

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem Toggle Checkmark with alpha value
« Reply #3 on: February 06, 2014, 10:20:29 PM »
Ah, there is that too, yes. You can make your sprite a child of a widget that has its alpha set to something less, like 0.5. Since alpha is cumulative, it will work as you expect.