how to add shadow to text in canvas nodejs

Solutions on MaxInterview for how to add shadow to text in canvas nodejs by the best coders in the world

showing results for - "how to add shadow to text in canvas nodejs"
Marta
29 Jul 2017
1const { createCanvas } = require('canvas')
2const width = 400
3const height = 400
4const canvas = createCanvas(width, height);
5
6var context = canvas.getContext('2d');
7	context.shadowColor = "black";
8    context.shadowBlur = 5;
9    context.shadowOffsetX = 3;
10    context.shadowOffsetY = 3;
11    context.font = '20px Arial'
12    context.fillStyle = '#fff'
13    context.fillText('Awesome! I did it.', width / 2 , 100)
14
15