6

How to draw shadow only in right and bottom side of object in createjs. there is no shadow over the object or on top and left side.

the shadow contains only 4 parameters
1. color of shadow 2. x 3. y 4. blur effect but it didn't tell anything about 4 different sides.

var box = createjs.Shape();
box.shadow = new createjs.shadow('#000',4,4,5);

the above code generates some blur portion over top and left part of object.

simonc
  • 41,632
  • 12
  • 85
  • 103
ashishkumar148
  • 975
  • 1
  • 10
  • 26
  • FYI, the Shadow class in EaselJS is just a wrapper for the shadow properties on Canvas, so any issues encountered with the usage above, will likely exist in Canvas without EaselJS. – Lanny Sep 07 '14 at 17:06

3 Answers3

2

Your example is working for me, I've tested on fiddle.net using firefox and chrome.

http://jsfiddle.net/by1vf7oc/

var box = new createjs.Shape();
box.graphics.beginFill("red").drawRect(100, 100, 100, 100);
box.shadow = new createjs.Shadow('#000', 4, 4, 5);

Try to test on these browsers, using the last version of the createjs.

renatopp
  • 1,275
  • 10
  • 17
1

Try this:

var box = new createjs.Shape();
box.graphics.beginFill("red").drawRect(0, 0, 100, 100);
box.shadow = new createjs.Shadow("#000000", 10, 10, 0);
jcdang
  • 549
  • 5
  • 7
1

this is giving dark black color with outline of shadow box over object. i need blurred shadow on right and bottom with no effect on object.

ashishkumar148
  • 975
  • 1
  • 10
  • 26