void OnGUI() { GUI.skin = skin; GUI.depth = depth; Color c = sets.color; c.a = time / sets.fadeTime; GUI.color = c; GUIStyle style = GUI.skin.label.FontSize(fontSize); Vector2 size = style.CalcSize(new GUIContent(message)); //Vector2 size = new Vector2(1, 1); //size.x += GUI.skin.box.padding.left + GUI.skin.box.padding.right + 2; //size.y += GUI.skin.box.padding.top + GUI.skin.box.padding.bottom + 2; //position -= size * .5f; //Debug.Log(size); /* * size.x /= Screen.width; * size.y /= Screen.height; * Rect area = new Rect(position.x, position.y, size.x, size.y); * area.x -= size.x *.5f; * area.y -= size.y *.5f; * msg.Draw(area); * //*/ //* Rect area = new Rect(position.x * Screen.width, position.y * Screen.height, size.x, size.y); area = area.Pad(4.0f); area = area.Move(-.5f, -.5f); if (outlined) { GUIF.Label(area, message, style); } else { GUI.Label(area, message, style); } //*/ }
void OnGUI() { Rect brush = transform.ToScreenArea(area.width, area.height); brush.x += area.x * Screen.width; brush.y += area.y * Screen.height; GUIStyle style = GUI.skin.label.Aligned(TextAnchor.MiddleCenter).FontSize(fontSize); GUI.color = color; GUIStyle prevStyle = GUI.skin.label; GUI.skin.label = style; GUIF.Label(brush, label, outline); GUI.skin.label = prevStyle; }
void OnGUI() { if (skin != "") { GUI.skin = GUISkins.Get(skin); } GUI.depth = depth; Rect brush = area; //Debug.Log("dicks"); Bars.graphic = tex; Bars.Draw(brush, repeat, val, tint, back, padding); if (message != "") { GUI.color = messageTint; GUIF.Label(brush, message); } }
void OnGUI() { GUI.depth = -100000; GUI.skin = skin; GUI.skin.FontSize(fontSize); GUIContent content; if (tex == null) { content = new GUIContent(tickMessage, tex); } else { content = new GUIContent(tickMessage); } Color col = color; if (fading) { col.a = alpha; } GUI.color = col; Rect brush = area.Denormalized(); if (isBox) { GUIF.Box(brush, content, padding); } else { GUIF.Label(brush, content, padding); } }
public new void Draw(Component caller) { GUIF.Label(area, content); }