Skip to content

DropShadow

Overview

DropShadow filter

EXPERIMENTAL! DO not use in production code yet

TODO: preventFit OR handle bounds increase (or both) https://github.com/phetsims/scenery/issues/1581

@author Jonathan Olson <jonathan.olson@colorado.edu>

Class DropShadow

import { DropShadow } from 'scenerystack/scenery';

Constructor

new DropShadow( offset : Vector2, blurRadius : number, color : TColor, filterRegionPercentage )

Instance Methods

getCSSFilterString() : string

Returns the CSS-style filter substring specific to this single filter, e.g. grayscale(1). This should be used for both DOM elements (https://developer.mozilla.org/en-US/docs/Web/CSS/filter) and when supported, Canvas (https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/filter).

isDOMCompatible() : boolean

applyCanvasFilter()

applySVGFilter( svgFilter : SVGFilterElement, inName : string, resultName? : string )

Source Code

See the source for DropShadow.ts in the scenery repository.