API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classDropShadowFilter

@codexo/exojs / rendering / stable

A Filter that draws a soft, offset silhouette of its input behind the input itself - the classic drop shadow. The shadow is the input's alpha coverage flattened to color, blurred by blur, and composited at offsetX/offsetY under the unchanged source. All lengths are logical units, so the shadow keeps its on-screen size at every pixel ratio and Filter.resolution. ```ts label.filters = [new DropShadowFilter({ offsetX: 2, offsetY: 3, blur: 3 })]; // A coloured glow: no offset, wide blur, saturated colour. glow.filters = [new DropShadowFilter({ offsetX: 0, offsetY: 0, blur: 12, color: new Color(80, 200, 255, 0.8) })]; ``` The silhouette pass shifts and recolours in one shader; the blur is the stock BlurFilter, so the whole effect runs on both backends.

7
props
4
methods
0
events
Import
import { DropShadowFilter } from '@codexo/exojs'

A Filter that draws a soft, offset silhouette of its input behind the input itself - the classic drop shadow.

The shadow is the input's alpha coverage flattened to color, blurred by blur, and composited at offsetX/offsetY under the unchanged source. All lengths are logical units, so the shadow keeps its on-screen size at every pixel ratio and Filter.resolution.

```ts label.filters = [new DropShadowFilter({ offsetX: 2, offsetY: 3, blur: 3 })];

// A coloured glow: no offset, wide blur, saturated colour. glow.filters = [new DropShadowFilter({ offsetX: 0, offsetY: 0, blur: 12, color: new Color(80, 200, 255, 0.8) })]; ```

The silhouette pass shifts and recolours in one shader; the blur is the stock BlurFilter, so the whole effect runs on both backends.

Constructors1
Methods4
Execute one filter pass: sample from input, write the result to output. Both textures are bounds × resolution texels - NOT the drawable's logical bounding box. Any parameter a subclass expresses in pixels (a blur radius, a displacement amount) is in LOGICAL units by convention and must be multiplied by resolution before it is used as a texel offset; otherwise the effect shrinks by 1/resolution on a HiDPI display. Parameters expressed as a fraction of the target (or as pure colour maths) need no adjustment. The engine always passes resolution. It is optional for the hand-rolled case - a post-processing chain that creates its own RenderTextures and calls apply directly - where the textures are whatever size the caller made them and 1 is the honest answer.
destroy(): void
Release any GPU-side resources held by this filter (uniform buffers, pipelines, intermediate textures). The base drops the attachment list; subclasses with GPU state (BlurFilter, ColorMatrixFilter) override and call super.destroy().
invalidate(): void
Tell every node this filter is attached to that its rendered output is out of date. Call it after mutating anything that changes what the filter draws or how far it reaches - the stock filters do this from their own setters. Without it a cached or retained representation of the owning node keeps replaying the result the filter produced before the change.
Properties7
resolution: TargetResolution
Resolution this filter's render targets are rasterized at, in device pixels per logical unit. 'inherit' (the default) matches the surface the result is composited into, so a filtered subtree stays as sharp as its surroundings on a HiDPI display. Lower it for a filter whose output is low-frequency anyway - a heavy blur at 0.5 costs a quarter of the fragments and is hard to tell apart. A filter CHAIN shares one target size, so the whole chain runs at the lowest resolution any of its filters asks for. ts const blur = new BlurFilter({ strength: 4 }); blur.resolution = 0.5; // half-resolution blur, quarter the fill cost
blur: number
Blur applied to the silhouette, in logical units. 0 gives a hard-edged shadow.
Shadow colour; its alpha is the shadow's opacity. Assigning copies the value, so the caller's colour can be reused.
offsetX: number
Shadow offset along x in logical units.
offsetY: number
Shadow offset along y in logical units.
quality: number
Tap cap for that blur, see BlurFilterOptions.quality.
shadowOnly: boolean
Draw only the shadow, leaving the source out of the result.
Source