// TODO DRAWER Add tooltip parameter public void DrawLabel(Rect rect, string label, object style, DrawingAlignment alignment = DrawingAlignment.MiddleLeft) { var guiStyle = (GUIStyle)style; var oldAlignment = guiStyle.alignment; guiStyle.alignment = ((TextAnchor)(int)alignment); GUI.Label(rect, label, guiStyle); guiStyle.alignment = oldAlignment; }
// TODO DRAWER Add tooltip parameter | Change the way it is done and separate icon from icon public void DrawLabelWithIcon(Rect rect, string label, string iconName, object style, DrawingAlignment alignment = DrawingAlignment.MiddleLeft) { var s = (GUIStyle)style; s.alignment = ((TextAnchor)(int)alignment); //GUI.Label(rect, label, s); GUI.Label(rect, new GUIContent(label, ElementDesignerStyles.GetSkinTexture(iconName)), s); }
// TODO DRAWER Add tooltip parameter public void DrawLabel(Rect rect, string label, object style, DrawingAlignment alignment = DrawingAlignment.MiddleLeft) { var guiStyle = (GUIStyle)style; var oldAlignment = guiStyle.alignment; guiStyle.alignment = ((TextAnchor)(int)alignment); GUI.Label(rect, label, guiStyle); guiStyle.alignment = oldAlignment; }
public void DrawTabLabel(Rect rect, string label, object style, DrawingAlignment alignment = DrawingAlignment.MiddleLeft) { if (Event.current.type != EventType.Repaint) { return; } var guiStyle = (GUIStyle)style; var oldAlignment = guiStyle.alignment; guiStyle.alignment = ((TextAnchor)(int)alignment); guiStyle.clipping = TextClipping.Clip; GUI.Label(rect, label, guiStyle); guiStyle.alignment = oldAlignment; }
// TODO DRAWER Add tooltip parameter | Change the way it is done and separate icon from icon public void DrawLabelWithIcon(Rect rect, string label, string iconName, object style, DrawingAlignment alignment = DrawingAlignment.MiddleLeft) { var s = (GUIStyle)style; s.alignment = ((TextAnchor)(int)alignment); //GUI.Label(rect, label, s); GUI.Label(rect, new GUIContent(label, ElementDesignerStyles.GetSkinTexture(iconName)), s); }