Pixi’VN
indexFunctions

Function: filterAreaCenter()

pixi-vn on GitHub

> filterAreaCenter(bounds, origin, filters, viewport?): object

Defined in: src/tickers/utility/filter-effect-utility.ts:37

Where an origin normalized (0-1) to the component's bounds lands, in pixels, inside the area PixiJS renders the component's filters into - the coordinates ShockwaveFilter/ZoomBlurFilter (center) and TwistFilter (offset) expect. Mirrors FilterSystem._calculateFilterBounds: the component's global bounds, clipped to the viewport, then grown on every side by the sum of every enabled filter's padding. Call it once all of the effect's filters are attached; it's a snapshot, so adding/removing padded filters later shifts the area.

Parameters

bounds

Rect

origin

x

number

y

number

filters

readonly object[]

viewport?

height

number

width

number

Returns

object

area

> area: Rect

x

> x: number

y

> y: number

On this page