Options
All
  • Public
  • Public/Protected
  • All
Menu

Creates a closed polygon drawing given a list of Vectors.

warning

Use sparingly as Polygons are performance intensive

Hierarchy

  • Polygon

Implements

Index

Constructors

constructor

Properties

anchor

anchor: Vector = new Vector(0, 0)

drawHeight

drawHeight: number

drawWidth

drawWidth: number

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

rotation

rotation: number = 0

scale

scale: Vector = new Vector(1, 1)

width

width: number

Methods

addEffect

  • addEffect(): void

clearEffects

  • clearEffects(): void

draw

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

removeEffect

  • removeEffect(index: number): void
  • removeEffect(effect: Effects.SpriteEffect): void

reset

  • reset(): void