Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - hurleybird

Pages: [1]
UI2DSprite is a widget.

GetComponent<UI2DSprite>().color =;

or just like any other widget:

GetComponent<UIWidget>().color =;


Other Packages / Re: Tasharen Fog of War change axis to 2D x-y
« on: June 21, 2014, 06:51:27 PM »
In the FOW.shader you will want to change .xz to .xy on line 52.

I'm also trying to get fog of war to work for an XY 2D game. These instructions don't seem valid any longer. In the current version line 52 reads as " = * 2.0 - 1.0;" and changing to .xy doesn't work. 

I don't think that will work, as tween color will change the sprite from one color to another over a specific duration when given a specific trigger. It's just a simple animation. I want to have the sprite be one color at value 1, another color at value 0, and slowly change from one to the other as that value goes from 1 to 0. That said, some of the code from tween color may be able to reused to help me create a new script with the functionality I need. Let me know if I'm mistaken or there's some other included script that functions the way I want it to though!


I got the color changing script created, but how do I actually assign that color to a UI2DSprite element?

I want to change the color of a sprite from green to red based off a value between 1 and 100. Before I go about coding this, is there an easy way to do this in NGUI that I'm not aware of?

NGUI 3 Support / How to make progress bar completely disappear at 0%?
« on: June 20, 2014, 01:48:27 AM »
Hi. I'm currently using a few short progress bars to display health for shield/armor facings in a game that I'm making. However, I'm noticing that when the value on the progress bar is at 0 there is still a small, but very noticeable, amount showing. How do you make it so that a value of 0 completely makes the progress bar go away?

Pages: [1]