public StartNodeElement() { _nodeNameLabel = new NodeNameLabel("Start From Here", 140); _rect = _rect = new Rect(0, 0, _nodeNameLabel.Width + EditorConstants.NodePadding * 2, _nodeNameLabel.Height + EditorConstants.NodePadding * 3); _defaultStyle = EditorConstants.GetNodeStyle(); _selectedStyle = EditorConstants.GetSelectedNodeStyle(); }
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; }
public ExpandingTextField(string startingInput, Func <string, bool> onChange) { _input = startingInput; _onChange = onChange; _style = EditorConstants.GetTextFieldStyle(); _style.wordWrap = true; _lineHeight = _style.CalcHeight(new GUIContent("Q"), 999); _rect = new Rect(0, 0, EditorConstants.TextFieldWidth, _lineHeight * Mathf.Max(1, _style.CalcLines(_input, EditorConstants.TextFieldWidth))); }
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 NodeElement(NodeContent content, Action removeNode) { _content = content; _contentSize = new Vector2(0, 0); _rect = new Rect(0, 0, 0, 0); _nodeNameLabel = new NodeNameLabel(_content.Name, _content.Width - EditorConstants.NodePadding * 2); _removeNodeButton = new TextButton("X", removeNode, EditorConstants.ButtonHeight); UpdateDimensions(); _defaultStyle = EditorConstants.GetNodeStyle(); _selectedStyle = EditorConstants.GetSelectedNodeStyle(); }
public TextButton(string text, Action onClick) : this(text, onClick, EditorConstants.GetLabelStyle().CalcSize(new GUIContent(text)).x + EditorConstants.ButtonPadding * 2) { }