API Docs for: 最后更新日期:2014年8月25日
Google搜索   
Show:

LDropShadowFilter Class

Extends LObject

Available since 1.6.0

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
)
public

Defined in filters/LDropShadowFilter.js:1

Available since 1.6.0

Parameters:

  • distance Int

    The offset distance for the shadow, in pixels.

  • angle Int

    The angle of the shadow.

  • color Int

    The color of the shadow.

  • blur Int

    The 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];

Item Index

Properties

Methods

callParent

(
  • functionName
  • arguments
)
public

Inherited from LObject: main/LObject.js:22

Available since 1.6.0

call the method of parent。

Parameters:

  • functionName String

    function's name

  • arguments Array

    Fixed 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
)
public

Defined in filters/LDropShadowFilter.js:56

Available since 1.6.0

Set the angle of the shadow.

Parameters:

  • angle Int

    the angle of the shadow.

setBlur

(
  • blur
)
public

Defined in filters/LDropShadowFilter.js:77

Available since 1.6.0

Set the amount of blur.

Parameters:

  • blur Int

    the amount of blur。

setColor

(
  • color
)
public

Defined in filters/LDropShadowFilter.js:67

Available since 1.6.0

Set the color of the shadow.

Parameters:

  • color Int

    the color of the shadow.

setDistance

(
  • distance
)
public

Defined in filters/LDropShadowFilter.js:45

Available since 1.6.0

Set the offset distance for the shadow.

Parameters:

  • distance Int

    the offset distance for the shadow.

Properties

objectIndex

Int public

Inherited from LObject: main/LObject.js:11

Available since 1.6.0

ID of the object