Createjs Shadow only in right and bottom
Asked Answered
G

3

7

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.

Goggle answered 5/9, 2014 at 6:50 Comment(1)
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.Validate
P
3

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.

Packard answered 5/9, 2014 at 13:35 Comment(0)
M
2

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);
Mathildemathis answered 5/9, 2014 at 7:46 Comment(1)
already tried but it gives same result as above with black color with more thicknessGoggle
G
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.

Goggle answered 5/9, 2014 at 8:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.