Announcement

Collapse
No announcement yet.

Change fill color of progress bar using graph

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Change fill color of progress bar using graph

    I was doing this tutorial here and I wanted to change the color of the Health bar when the health is at certain ranges. I know how to do the logic gate but I just can't seem to find out how to change the fill color.


    I tried binding a function to the Fill Color and Opacity then I tried using the Set Color and Opacity function (couldn't get it to work), tried assigning value to a Linear Color variable and return that (didn't work), tried calling the progress bar widget and then using the Set Fill Color and Opacity (didn't work). The only thing that seems to even return sucessfully is when return the Fill Color and Opacity variable from the progress bar widiget. How do I change that value? The Setter doesn't seem to work or I am doing something wrong.


    Here are simplistic images of what I tired (without the logic gate).
    Click image for larger version

Name:	Results.png
Views:	1
Size:	226.7 KB
ID:	1145874


    If anyone would be willing to assist me on changing color of a progress bar I would really appreciate it!

    Thanks in advance,

    Andrew

    #2
    So...I feel really stupid right now. I just realized I had the alpha as 0 instead of 1...

    Though, I would still like to know if there is a better approach than mine.

    Click image for larger version

Name:	Screenshot 2015-03-13 16.51.47.png
Views:	1
Size:	343.1 KB
ID:	1068393

    Thanks,

    Andrew

    Comment


      #3
      Don't set anything in your getter, those functions are suppose to be pure and have no side effects. So do the color changes in Tick, or add another binding for just the color.

      Comment


        #4
        Where should I add the binding to? Otherwise I will do as you suggest and move it to the tick section of the event graph.

        Thanks,

        Andrew

        Comment


          #5
          Originally posted by Gibs View Post
          Where should I add the binding to? Otherwise I will do as you suggest and move it to the tick section of the event graph.

          Thanks,

          Andrew
          A little late, but you don't need to set a binding if you do the Event Tick method and get your Progress Bar (Mine named BatteryBar).

          Click image for larger version

Name:	multicolor.png
Views:	1
Size:	142.8 KB
ID:	1080417

          Comment

          Working...
          X