public ElementLabel(IElement innerElement, string name)
 {
     _element              = innerElement;
     _elementName          = name + ":";
     _labelRect            = new Rect(0, 0, EditorConstants.ElementLabelWidth, EditorConstants.LineHeight);
     _labelStyle           = EditorConstants.GetLabelStyle();
     _labelStyle.alignment = TextAnchor.MiddleLeft;
 }
예제 #2
0
 public NodeNameLabel(string name, float width)
 {
     _name            = name;
     Width            = width;
     _rect            = new Rect(0, 0, width, EditorConstants.LineHeight);
     _style           = EditorConstants.GetLabelStyle();
     _style.alignment = TextAnchor.MiddleCenter;
     _style.fontStyle = FontStyle.Bold;
 }
 public TextButton(string text, Action onClick, float width)
 {
     _text                 = text;
     _onClick              = onClick;
     _labelStyle           = EditorConstants.GetLabelStyle();
     _labelStyle.alignment = TextAnchor.MiddleCenter;
     _rect                 = new Rect(0, 0, width, EditorConstants.LineHeight);
     _buttonStyle          = EditorConstants.GetButtonStyle();
 }
 public TextButton(string text, Action onClick)
     : this(text, onClick, EditorConstants.GetLabelStyle().CalcSize(new GUIContent(text)).x + EditorConstants.ButtonPadding * 2)
 {
 }