Interface: ShapePrimitive

ShapePrimitive

A basic object to define a Pixi shape.

Properties:
Name Type Description
type SHAPE_PRIMITIVE

The type of the object, mainly used to avoid instanceof checks

x number

The X coordinate of the shape

y number

The Y coordinate of the shape

Members

type SHAPE_PRIMITIVE readonly

The type of the object, mainly used to avoid instanceof checks

x number readonly

The X coordinate of the shape

y number readonly

The Y coordinate of the shape

Methods

Creates a clone of this ShapePrimitive instance.

Returns:
Type Description
ShapePrimitive

contains (x, y) boolean

Checks whether the x and y coordinates passed to this function are contained within this ShapePrimitive.

Name Type Description
x number
y number
Returns:
Type Description
boolean

copyFrom (source) void

Copies the properties from another ShapePrimitive to this ShapePrimitive.

Name Type Description
source ShapePrimitive

copyTo (destination) void

Copies the properties from this ShapePrimitive to another ShapePrimitive.

Name Type Description
destination ShapePrimitive

getBounds (out) Rectangle

Returns the framing rectangle of the ShapePrimitive as a Rectangle object.

Name Type Attributes Description
out Rectangle <optional>
Returns:
Type Description
Rectangle

strokeContains (x, y, strokeWidth) boolean

Checks whether the x and y coordinates passed to this function are contained within the stroke of this shape

Name Type Description
x number
y number
strokeWidth number
Returns:
Type Description
boolean