ShapeNode

public class ShapeNode: Node, Renderable

A ShapeNode is a node for creating colored shapes. Currently only supports rectangular shapes.

  • Undocumented

    Declaration

    Swift

    public class ShapeNode: Node, Renderable
  • Undocumented

    Declaration

    Swift

    public class ShapeNode: Node, Renderable
  • Undocumented

    Declaration

    Swift

    public class ShapeNode: Node, Renderable
  • Undocumented

    Declaration

    Swift

    public class ShapeNode: Node, Renderable
  • Designated initializer. Creates a rectangular shape node of a given color.

    Declaration

    Swift

    public init(width: Float, height: Float, color: Color)

    Parameters

    width

    The width of the shape.

    height

    The height of the shape.

    color

    The color of the shape.

    Return Value

    A new instance of a rectangular ShapeNode.

  • Convenience init. Creates a rectangular shape node of a given color.

    • discussion: Most of this engine uses Float but Swift likes to default numbers to Doubles.

    Declaration

    Swift

    public convenience init<T: FloatLiteralConvertible>(width: T, height: T, color: Color)

    Parameters

    width

    The width of the shape.

    height

    The height of the shape.

    color

    The color of the shape.

    Return Value

    A new instance of ShapeNode.

  • Convenience initializer. Creates a rectangular shape node of a given color.

    Declaration

    Swift

    public convenience init(size: CGSize, color: Color)

    Parameters

    size

    The size of the shape.

    color

    The color of the shape.

    Return Value

    A new instance of a rectangular ShapeNode.