Options
All
  • Public
  • Public/Protected
  • All
Menu

Polygon Mask manager

Hierarchy

  • PolygonMaskInstance

Implements

Index

Constructors

constructor

Properties

Private Readonly container

container: Container

dimension

dimension: IDimension

Optional offset

offset: ICoordinates

Readonly options

options: PolygonMask

Readonly path2DSupported

path2DSupported: boolean

Optional paths

paths: ISvgPath[]

Private polygonMaskMoveRadius

polygonMaskMoveRadius: number

Optional raw

Optional redrawTimeout

redrawTimeout: undefined | number

Methods

Private checkInsidePolygon

  • checkInsidePolygon(position: ICoordinates | undefined): boolean

clickPositionValid

Private createPath2D

  • createPath2D(): void

Private downloadSvgPath

  • downloadSvgPath(svgUrl?: undefined | string, force?: undefined | false | true): Promise<ICoordinates[] | undefined>
  • Depends on SVGPathSeg API polyfill https://github.com/progers/pathseg for Chrome Deprecate SVGPathElement.getPathSegAtLength removed in: Chrome for desktop release 62 Chrome for Android release 62 Android WebView release 62 Opera release 49 Opera for Android release 49

    Parameters

    • Optional svgUrl: undefined | string
    • Optional force: undefined | false | true

    Returns Promise<ICoordinates[] | undefined>

draw

  • draw(context: CanvasRenderingContext2D): void

Private drawPoints

  • drawPoints(): void

Private getEquidistantPointByIndex

Private getPointByIndex

Private getRandomPoint

Private getRandomPointByLength

initAsync

Private initRawData

  • initRawData(force?: undefined | false | true): Promise<void>

Private parseSvgPath

  • parseSvgPath(xml: string, force?: undefined | false | true): ICoordinates[] | undefined

particleBounce

  • particleBounce(particle: Particle): boolean

particlePosition

particlesInitialization

  • particlesInitialization(): boolean

Private randomPoint

resize

  • resize(): void

stop

  • stop(): void