Hi,
I really don't know enough about Pixels to make an accurate judgement as to why the following does not work, but please, if someone can guide me in the right direction about coloring a progress bar, I could really learn a lot..
Color [] m_color, cols;
int mipCount;
// Use this for initialization
void Start ()
{
FatigueEmpty = (Texture2D) Instantiate(renderer.material.mainTexture);
renderer.material.mainTexture = FatigueEmpty;
m_color = new Color[3];
m_color[0] = Color.green;
m_color[1] = Color.green;
m_color[2] = Color.green;
mipCount = Mathf.Min(3, FatigueEmpty.mipmapCount);
for (int mip = 0; mip < mipCount; ++mip)
{
cols = FatigueEmpty.GetPixels(mip);
for (int i = 0; i < cols.Length; ++i)
{
cols <em>= Color.Lerp(cols*, m_color[mip], 0.33f);*</em>
_*} // end cols.Length iteration*_
_*FatigueEmpty.SetPixels(cols, mip);*_
_*} // End mipCount iteration*_
_*FatigueEmpty.Apply(false);*_
_*} // End Start()*_
<em>*public static IEnumerator Player_1_GUI()*</em>
_*{*_
_*Vector2 size = new Vector2(275, 11.5f); // < 11.5 causes a middle line 2B drawn :(*_
_*// FATIGUE - Green*_
_*GUI.BeginGroup( new Rect ( size.x, 0, 256, size.y));*_
_*GUI.Box( new Rect ( 0, 0, 256, size.y), FatigueEmpty);*_
<em>_GUI.BeginGroup( new Rect ( 0, 0, 256 * fatigue, size.y));_</em>
_*GUI.Box(new Rect ( 0, 0, 256, size.y), FatigueEmpty);*_
_*GUI.EndGroup();*_
_*GUI.EndGroup();*_
_*}//End Fatigue Progress Bar*_
_*```*_
_*<p>I would like to emphasize that everything is fine about the in-game GUI's. The box is drawn and I can see it fill up (grey) during certain conditions. What I am trying to acheive is to color the box dark green, for an empty fatigue, and light green for full or progressing bar.</p>*_
_*<p>I was hoping, that adding the code in the Start() method would change the bar from grey to green. Is it appropriate to design an image in photoshop and load it somehow using Texture2D? Regardless of that happening I would still need to have the progress bar fill up as a green color.</p>*_