| Package | org.aswing.graphics |
| Class | public class GradientBrush |
| Implements | IBrush |
See also
| Method | Defined by | ||
|---|---|---|---|
|
GradientBrush(fillType:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix, spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0)
Create a GradientBrush object
you can refer the explaination for the paramters from Adobe's doc to create a Matrix, you can use matrix.createGradientBox() from the matrix object itself | GradientBrush | ||
|
beginFill(target:Graphics):void
This method will be called by Graphics2D autumaticlly.
It applys the fill paramters to the instance of flash.display.Graphics | GradientBrush | ||
|
endFill(target:Graphics):void
This method will be called by Graphics2D autumaticlly.
It marks the end of filling | GradientBrush | ||
|
getAlphas():Array
| GradientBrush | ||
|
getColors():Array
| GradientBrush | ||
|
getFillType():String
| GradientBrush | ||
|
getMatrix():Object
| GradientBrush | ||
|
getRatios():Array
| GradientBrush | ||
|
setAlphas(alphas:Array):void
Pay attention that the value in the array should be between 0-1.
| GradientBrush | ||
|
setColors(cs:Array):void
| GradientBrush | ||
|
setFillType(t:String):void
| GradientBrush | ||
|
setMatrix(m:Matrix):void
| GradientBrush | ||
|
setRatios(ratios:Array):void
Ratios should be between 0-255, if the value is greater than 255, 255 will be used, if the value is less than 0, 0 will be used
| GradientBrush | ||
| Constant | Defined by | ||
|---|---|---|---|
| LINEAR : String = "linear" [static]
| GradientBrush | ||
| RADIAL : String = "radial" [static]
| GradientBrush | ||
| GradientBrush | () | constructor |
public function GradientBrush(fillType:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix, spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0)
Create a GradientBrush object
you can refer the explaination for the paramters from Adobe's doc
to create a Matrix, you can use matrix.createGradientBox() from the matrix object itself
fillType:String |
|
colors:Array |
|
alphas:Array |
|
ratios:Array |
|
matrix:Matrix |
|
spreadMethod:String (default = "pad") |
|
interpolationMethod:String (default = "rgb") |
|
focalPointRatio:Number (default = 0) |
See also
| beginFill | () | method |
public function beginFill(target:Graphics):void
This method will be called by Graphics2D autumaticlly.
It applys the fill paramters to the instance of flash.display.Graphics
target:Graphics — the instance of a flash.display.Graphics
|
| endFill | () | method |
public function endFill(target:Graphics):void
This method will be called by Graphics2D autumaticlly.
It marks the end of filling
target:Graphics — the instance of a flash.display.Graphics
|
| getAlphas | () | method |
public function getAlphas():Array
Returns
Array |
| getColors | () | method |
public function getColors():Array
Returns
Array |
| getFillType | () | method |
public function getFillType():String
Returns
String |
| getMatrix | () | method |
public function getMatrix():Object
Returns
Object |
| getRatios | () | method |
public function getRatios():Array
Returns
Array |
| setAlphas | () | method |
public function setAlphas(alphas:Array):voidPay attention that the value in the array should be between 0-1. if the value is greater than 1, 1 will be used, if the value is less than 0, 0 will be used
Parametersalphas:Array |
| setColors | () | method |
public function setColors(cs:Array):voidParameters
cs:Array |
| setFillType | () | method |
public function setFillType(t:String):voidParameters
t:String |
| setMatrix | () | method |
public function setMatrix(m:Matrix):voidParameters
m:Matrix |
| setRatios | () | method |
public function setRatios(ratios:Array):voidRatios should be between 0-255, if the value is greater than 255, 255 will be used, if the value is less than 0, 0 will be used
Parametersratios:Array |
| LINEAR | constant |
public static const LINEAR:String = "linear"
| RADIAL | constant |
public static const RADIAL:String = "radial"