LDropShadowFilter Class
The DropShadowFilter class lets you add a drop shadow to display objects. The shadow algorithm is based on the same box filter that the blur filter uses. You have several options for the style of the drop shadow, including inner or outer shadow and knockout mode. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject class).
Constructor
LDropShadowFilter
-
distance
-
angle
-
color
-
blur
Parameters:
-
distance
IntThe offset distance for the shadow, in pixels.
-
angle
IntThe angle of the shadow.
-
color
IntThe color of the shadow.
-
blur
IntThe amount of blur.
Example:
var bitmapdata = new LBitmapData(event.target);
var bitmap = new LBitmap(bitmapdata);
addChild(bitmap);
var shadow = new LDropShadowFilter(5,45,"#000000");
bitmap.filters = [shadow];
Methods
callParent
-
functionName
-
arguments
call the method of parent。
Parameters:
-
functionName
Stringfunction's name
-
arguments
ArrayFixed value : arguments
Example:
function funA(){
LExtends(this,LObject,[]);
}
funA.prototype.myName = function(){
return "AAA";
}
function funB(){
LExtends(this,funA,[]);
}
funB.prototype.myName = function(){
return "BBB";
}
function funC(){
LExtends(this,funA,[]);
}
funC.prototype.myName = function(){
return this.callParent("myName",arguments);
}
LInit(1000/50,"legend",800,150,main);
function main(){
LGlobal.setDebug(true);
var objB = new funB();
trace(objB.myName());//BBB
var objC = new funC();
trace(objC.myName());//AAA
}
setAngle
-
angle
Set the angle of the shadow.
Parameters:
-
angle
Intthe angle of the shadow.
setBlur
-
blur
Set the amount of blur.
Parameters:
-
blur
Intthe amount of blur。
setColor
-
color
Set the color of the shadow.
Parameters:
-
color
Intthe color of the shadow.
setDistance
-
distance
Set the offset distance for the shadow.
Parameters:
-
distance
Intthe offset distance for the shadow.
Properties
objectIndex
Int
public
ID of the object