Skip to content

Use offset when sampling SDF texture to implement drop shadow effect, see Pixi.js DropShadow Filter.

ts
const text = new Text({
    x: 50,
    y: 100,
    content: 'Hello, world!',
    fontSize: 30,
    fill: '#F67676',
    dropShadowColor: '#000000',
    dropShadowOffsetX: 2,
    dropShadowOffsetY: 2,
    dropShadowBlurRadius: 10,
});

Released under the MIT License.