HTML5 Canvas Set Opacity with KineticJS

To set a shape opacity with KineticJS, we can set the opacity property when we instantiate the shape, or we can use the setOpacity() method.  Shapes can have an opacity value between 0 and 1, where 0 is fully transparent, and 1 is fully opaque.  Unless otherwise specified, all shapes are defaulted with an opacity value of 1.

Instructions: Mouseover the pentagon to change its opacity.

Open in new window

Code Editor

Modified on April 9th, 2013 by Eric Rowell
comments powered by Disqus