Skip to content

PixelPerfectHitArea

Pixel perfect hit area

Implements

  • IHitArea

Constructors

new PixelPerfectHitArea()

new PixelPerfectHitArea(pRenderer, pTarget, pThreshhold): PixelPerfectHitArea

Parameters

pRenderer: Renderer

pTarget: Sprite

pThreshhold: number= 0

Returns

PixelPerfectHitArea

Source

src/input/PixelPerfectHitArea.ts:13

Accessors

height

get height(): number

Gets height

Returns

number

Source

src/input/PixelPerfectHitArea.ts:54


scaledHeight

get scaledHeight(): number

Gets scaled height

Returns

number

Source

src/input/PixelPerfectHitArea.ts:61


scaledWidth

get scaledWidth(): number

Gets scaled width

Returns

number

Source

src/input/PixelPerfectHitArea.ts:47


width

get width(): number

Gets width

Returns

number

Source

src/input/PixelPerfectHitArea.ts:40

Methods

contains()

contains(pX, pY): boolean

Contains pixel perfect hit area

Parameters

pX: number

pY: number

Returns

boolean

boolean

Implementation of

IHitArea.contains

Source

src/input/PixelPerfectHitArea.ts:81


getHitAreaAtPixel()

getHitAreaAtPixel(pX, pY): boolean

Gets hit area at pixel

Parameters

pX: number

pY: number

Returns

boolean

boolean

Source

src/input/PixelPerfectHitArea.ts:71