Star

public class Star: Polygon

Star is a concrete subclass of Polygon that defines a star shape.

  • Initializes a new Star shape.

    let star = Star(
            center: canvas.center,
        pointCount: 5,
       innerRadius: 50,
       outerRadius: 100)
    canvas.add(star)
    

    Declaration

    Swift

    convenience public init(center: Point, pointCount: Int, innerRadius: Double, outerRadius: Double)

    Parameters

    center

    The center of the star

    pointCount

    The number of points on the star

    innerRadius

    The radial distance from the center of the star to the inner points

    outerRadius

    The radial distance from the center of the start to the outer points