Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: jeaky on March 16, 2013, 12:49:16 PM

Title: How to control alpha use slider
Post by: jeaky on March 16, 2013, 12:49:16 PM
Hi, I want use slider to control the alpha value, but I don't know how to write the code, I have writed some code bellow but not have any change in the scene. Anyone help me plz ?

var slider : float = 1;
var v1 : GameObject;

function OnSliderChange () {

     v1.renderer.material.color.a = slider;

}
Title: Re: How to control alpha use slider
Post by: jeaky on March 18, 2013, 05:50:02 PM
any help?
Title: Re: How to control alpha use slider
Post by: ArenMook on March 18, 2013, 08:05:42 PM
Widgets don't have a renderer. Get the UIWidget component and modify its alpha property.