unity3d怎么调字体的alpha值

2025-04-04 04:51:11
推荐回答(1个)
回答1:

GUIStyle里有参数可以调,如下:
public GUIStyle thestyle;
thestyle.normal.textcolor=new Color(0,0,0,0);
Color的第四个参数就是alpha值
如果要渐变可以用
thestyle.normal.textcolor=Color.Lerp(thestyle.normal.textcolor,new Color(0,0,0,0),Time.deltaTime);第二个参数是你想要变化成的颜色,第三个是速度。
注意,如果用C#不能直接用Color.a获取alpha来对其进行改变,jsp下可以