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
widthThe width of the shape.
heightThe height of the shape.
colorThe 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
Floatbut Swift likes to default numbers toDoubles.
Declaration
Swift
public convenience init<T: FloatLiteralConvertible>(width: T, height: T, color: Color)Parameters
widthThe width of the shape.
heightThe height of the shape.
colorThe 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
sizeThe size of the shape.
colorThe color of the shape.
Return Value
A new instance of a rectangular
ShapeNode.
-
Undocumented
Declaration
Swift
public class ShapeNode: Node, Renderable
ShapeNode Class Reference