示例#1
0
        //-------------------------------------------------------------------------------------------------------------
        public override void Draw(Rect sRect)
        {
            // Do drawing with purcent
            float tWidth  = sRect.width * Purcent;
            float tHeight = sRect.height * Purcent;
            int   tRadius = (int)Mathf.Max(tWidth, tHeight);

            //float tX = sRect.position.x + (sRect.width - tWidth) / 2.0F;
            //float tY = sRect.position.y + (sRect.height - tHeight) / 2.0F;
            STSDrawing.DrawCircle(sRect.center, tRadius, TintPrimary, tWidth, ParameterOne);
        }
示例#2
0
        // Other than method name, DrawBezierLine is unchanged from Linusmartensson's original implementation.
        public static void DrawBezierLine(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 + 1; ++i)
            {
                Vector2 v = CubeBezier(start, startTangent, end, endTangent, i / (float)segments);
                STSDrawing.DrawLine(lastV, v, color, width, antiAlias);
                lastV = v;
            }
        }