- Home /
 
               Question by 
               danhanly · Jul 09, 2012 at 11:00 AM · 
                colortexture2dguitexturealpha  
              
 
              Modifying and Saving a GUITexture
I've got a series of buttons in my game and I want to dynamically create 'over' states for the buttons. What I would like to do is take my 'normal image', adjust the alpha and save it as a different texture so I can use them both independently.
I have a script called 'InterfaceButton' which accepts normalTexture:Texture2D and overTexture:Texture2D as arguments.
I want to add this script to a dynamically created button:
     for(var i=0;i<componentsSelection.length;i++){
  var instrument:GameObject = new GameObject();
  var normalTexture:GUITexture = Resources.Load(componentSelectedIcons[i]);
  
  instrument.AddComponent(GUITexture);
  instrument.transform.position.z = 5;
  instrument.transform.localScale = Vector3.zero;
       
  instrument.guiTexture.texture = normalTexture;
  instrument.guiTexture.pixelInset.x=Rect(x,y,width,height);
  x += (width+rightPadding);
  
  var buttonScript:InterfaceButton = instrument.AddComponent(InterfaceButton);
  buttonScript.normalTexture = normalTexture;
  buttonScript.overTexture = //how to manage this?
  }
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
Problem with GUITexture.color.a 2 Answers
guiTexture color half alpha White? 1 Answer
Alpha Problems With Render Textures 0 Answers
Changing a GUITexture's alpha gives me no effect in game. 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                