Blog Design Development Mobile Inspiration CSS Javascript News Opinions Politics Menu

Canvas Cheat Sheet

HTML5 Canvas Cheat Sheet
HTML5 Canvas Text Font, Size, and Style Tutorial

HTML5 Canvas Shadow Text Tutorial

Description

Use this code to add different shadows to your canvas text. In canvas, there are 4 different shadow properties: offsetX, offsetY, shadowColor, and shadowBlur. Offsets X and Y are just the values at which the shadow should be separated from the actual text. shadowColor refers to the color of the shadow -- this one needs to be set because the default shadowColor value is transparent, meaning the a shadow won't be visible unless you set this. shadowBlur takes a numerical value and smoothes the edges of the shadow to make it more aesthetically pleasing.

Demo