Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Polygon

Creates a closed polygon drawing given a list of [[Point]]s.

warning

Use sparingly as Polygons are performance intensive

Hierarchy

  • Polygon

Implements

Index

Constructors

constructor

  • Parameters

    • points: Vector[]

      The vectors to use to build the polygon in order

    Returns Polygon

Properties

Private _points

_points: Vector[] = []

anchor

anchor: Vector = new Vector(0, 0)

fillColor

fillColor: Color

The color to use for the interior of the polygon

filled

filled: boolean = false

Indicates whether the polygon is filled or not.

flipHorizontal

flipHorizontal: boolean

flipVertical

flipVertical: boolean

height

height: number

lineColor

lineColor: Color

The color to use for the lines of the polygon

lineWidth

lineWidth: number = 5

The width of the lines of the polygon

naturalHeight

naturalHeight: number

naturalWidth

naturalWidth: number

rotation

rotation: number = 0

scale

scale: Vector = new Vector(1, 1)

width

width: number

Methods

addEffect

  • notimplemented

    Effects are not supported on Polygon

    Parameters

    Returns void

clearEffects

  • clearEffects(): void
  • notimplemented

    Effects are not supported on Polygon

    Returns void

draw

  • draw(ctx: CanvasRenderingContext2D, x: number, y: number): void
  • Parameters

    • ctx: CanvasRenderingContext2D
    • x: number
    • y: number

    Returns void

removeEffect

  • removeEffect(index: number): any
  • removeEffect(effect: ISpriteEffect): any
  • notimplemented

    Effects are not supported on Polygon

    Parameters

    • index: number

    Returns any

  • notimplemented

    Effects are not supported on Polygon

    Parameters

    Returns any

reset

  • reset(): void
  • Returns void