Example #1
0
        public virtual void DrawSelectedOutline()
        {
            Rect BoxBounds = GetBoxBounds();

            // Top line
            VisualScriptingDrawing.DrawLine(new Vector2(-SelectionOffset - (BoxBounds.width * 0.5f), -SelectionOffset), new Vector2(SelectionOffset + (BoxBounds.width * 0.5f), -SelectionOffset), SelectionColor, SelectionWidth, false);
            // Right line
            VisualScriptingDrawing.DrawLine(new Vector2(SelectionOffset + BoxBounds.width, -SelectionOffset), new Vector2(SelectionOffset + BoxBounds.width, SelectionOffset + BoxBounds.height), SelectionColor, SelectionWidth, false);
            // Bottom line
            VisualScriptingDrawing.DrawLine(new Vector2(-SelectionOffset - (BoxBounds.width * 0.5f), SelectionOffset + BoxBounds.height), new Vector2(SelectionOffset + (BoxBounds.width * 0.5f), SelectionOffset + BoxBounds.height), SelectionColor, SelectionWidth, false);
            // Left line
            VisualScriptingDrawing.DrawLine(new Vector2(-SelectionOffset, -SelectionOffset), new Vector2(-SelectionOffset, SelectionOffset + BoxBounds.height), SelectionColor, SelectionWidth, false);
        }
Example #2
0
        public static void bezierLine(Vector2 start, Vector2 startTangent, Vector2 end, Vector2 endTangent, Color color, float width, bool antiAlias, int segments)
        {
            Vector2 lastV = cubeBezier(start, startTangent, end, endTangent, 0);

            for (int i = 1; i <= segments; ++i)
            {
                Vector2 v = cubeBezier(start, startTangent, end, endTangent, i / (float)segments);

                VisualScriptingDrawing.DrawLine(
                    lastV,
                    v,
                    color, width, antiAlias);
                lastV = v;
            }
        }