/// <summary> /// Draws a node header with the node name. /// </summary> /// <param name="y">The start point.</param> /// <returns>Returns the size of the draw area.</returns> protected internal Rect DrawNodeHeader(float y) { Rect topRect = new Rect(0, y, node.size.x, Styles.headerHeight); if (!Event.current.IsRepaintEvent()) { return(topRect); } BorderRadius radius = new BorderRadius(Styles.nodeBorderRadius.topLeft, Styles.nodeBorderRadius.topRight, 0, 0); EditorGUI.DrawSolidTexture(topRect, colors.primaryColor3, radius); EditorGUI.Label(Styles.nodeLabelPaddingLeft, y, topRect.width - Styles.nodeLabelPaddingLeft, topRect.height, node.name, Styles.nodeLabelStyle); EditorGUI.DrawSolidTexture(topRect, Styles.outlineColor.color, new BorderWidth(Styles.outlineWidth, Styles.outlineWidth, Styles.outlineWidth, 0), radius); return(topRect); }
public static void DrawSolidTexture(Rect rect, Color color, BorderWidth borderWidth, BorderRadius borderRadius) { DrawTexture(rect, solidWhite, ScaleMode.StretchToFill, defaultTextureAspect, color, defaultAlphaBlend, borderWidth, borderRadius); }
public static void DrawTexture(Rect rect, Texture texture, ScaleMode scaleMode, float textureAspect, Color color, bool alphaBlend, BorderWidth borderWidth, BorderRadius borderRadius) { GUI.DrawTexture(rect, texture, scaleMode, alphaBlend, textureAspect, color, new Vector4(borderWidth.left, borderWidth.top, borderWidth.right, borderWidth.bottom), new Vector4(borderRadius.topLeft, borderRadius.topRight, borderRadius.bottomRight, borderRadius.bottomLeft)); }
public static void DrawSolidTexture(Rect rect, Color color, BorderRadius borderRadius) { DrawSolidTexture(rect, color, BorderWidth.zero, borderRadius); }