actionscript 3 - Draw shadow without filter on Graphics object -


i have complex graphics data on sprite or shape (no matter exactly). want draw shadow (inner too) 1 rect ( [10, 10, 240, 25] example) or path.

  /// code before   grobj.graphics.drawrect( 10, 10, 240, 25);       /// -> draw inner shadow on objcect somehow   /// code after 

is possible perform w\o filters?

ps. http://ipicture.ru/uploads/100927/rhzf1k6exu.png


solving:

bitmapdata(*).applyfilter( *,*,*,*); // play function :) 

also http://help.adobe.com/ru_ru/as3lcr/flash_10.0/flash/display/bitmapdata.html#applyfilter()

i'm assuming don't want add filters object because plan on adding colortransform , not want filters change color.

if that's case can separate filter creating sprite of same size original, add drop shadow filter new sprite hideobject parameter set true.

//display object var grobj:sprite = new sprite(); grobj.graphics.beginfill(0xff0000, 1); grobj.graphics.drawrect(0, 0, 240, 25); grobj.graphics.endfill();  //filter object var dsfilter:sprite = new sprite(); dsfilter.graphics.beginfill(0); dsfilter.graphics.drawrect(0, 0, grobj.width, grobj.height); dsfilter.graphics.endfill();  dsfilter.filters = [new dropshadowfilter(4.0, 45, 0, 1.0, 4.0, 4.0, 1.0, 3, true, false, true)];  //display list grobj.x = dsfilter.x = 10; grobj.y = dsfilter.y = 10;  addchild(grobj); addchild(dsfilter); 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -