void OnGUI(){
GUI.skin = myskin;
Color color = new Color (230f, 0f, 0f, 1f); //文字颜色
Color pcolor =new Color (230, 120, 0, 1); //描边颜色
Rect pos= new Rect(10,10,100,40) ;
MakeStroke(pos, "你好", color, pcolor);
}
void MakeStroke(Rect position ,string txt,Color txtColor,Color outlineColor ){
position.y -=1;
GUI.color=outlineColor;
GUI.Label(position, txt);
position.y += 1*2;
GUI.Label(position, txt);
position.y -= 1;
position.x -= 1;
GUI.Label(position, txt);
position.x += 1*2;
GUI.Label(position, txt);
position.x -= 1;
GUI.color = txtColor;
GUI.Label(position, txt);
}
这个其实就是将写五个字体,然后将他们重叠在一起,看起来就是添加了边框的效果,效果还不错