Class: Star

PIXI.Star

Draw a star shape with an arbitrary number of points.

new PIXI.Star (x, y, points, radius, innerRadius, rotation)PIXI.Graphics

Name Type Default Description
x number

Center X position of the star

y number

Center Y position of the star

points number

The number of points of the star, must be > 1

radius number

The outer radius of the star

innerRadius number optional

The inner radius between points, default half radius

rotation number 0 optional

The rotation of the star in radians, where 0 is vertical

Returns:
Type Description
PIXI.Graphics This Graphics object. Good for chaining method calls

Extends

Members

points Array.<number> inherited

An array of the points of this polygon

type number readonly inherited

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

Default Value:
  • PIXI.SHAPES.POLY
See:

Methods

Creates a clone of this polygon

Returns:
Type Description
PIXI.Polygon a copy of the polygon

Closes the polygon, adding points if necessary.

contains (x, y)boolean inherited

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

Name Type Description
x number

The X coordinate of the point to test

y number

The Y coordinate of the point to test

Returns:
Type Description
boolean Whether the x/y coordinates are within this polygon