LColorTransform Class
Creates a LColorTransform object for a display object with the specified color channel values and alpha values. The ColorTransform class lets you adjust the color values in a display object. The color adjustment or color transformation can be applied to all four channels: red, green, blue, and alpha transparency. When a ColorTransform object is applied to a display object, a new value for each color channel is calculated like this: ・New red value = (old red value redMultiplier) + redOffset ・New green value = (old green value greenMultiplier) + greenOffset ・New blue value = (old blue value blueMultiplier) + blueOffset ・New alpha value = (old alpha value alphaMultiplier) + alphaOffset If any of the color channel values is greater than 255 after the calculation, it is set to 255. If it is less than 0, it is set to 0. You can use ColorTransform objects in the following ways: ・In the colorTransform parameter of the colorTransform() method of the LBitmapData class
Constructor
LColorTransform
-
redMultiplier
-
greenMultiplier
-
blueMultiplier
-
alphaMultiplier
-
redOffset
-
greenOffset
-
blueOffset
-
alphaOffset
Parameters:
-
redMultiplier
FloatThe value for the red multiplier, in the range from 0 to 1.
-
greenMultiplier
FloatThe value for the green multiplier, in the range from 0 to 1.
-
blueMultiplier
FloatThe value for the blue multiplier, in the range from 0 to 1.
-
alphaMultiplier
FloatThe value for the alpha transparency multiplier, in the range from 0 to 1.
-
redOffset
FloatThe offset value for the red color channel, in the range from -255 to 255.
-
greenOffset
FloatThe offset value for the green color channel, in the range from -255 to 255.
-
blueOffset
FloatThe offset for the blue color channel value, in the range from -255 to 255.
-
alphaOffset
FloatThe offset for alpha transparency channel value, in the range from -255 to 255.
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
}
Properties
objectIndex
Int
public
ID of the object