グラデーション
♥0 |
Line 22 |
Modified 2010-04-14 18:33:23 |
MIT License
archived:2017-03-20 07:51:55
ActionScript3 source code
/**
* Copyright _wonder ( http://wonderfl.net/user/_wonder )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/veYm
*/
package {
import flash.display.Sprite;
import flash.display.GradientType;
import flash.events.MouseEvent;
import flash.geom.Matrix;
public class Gradient extends Sprite {
public function Gradient() {
init();
}
private function init():void {
graphics.lineStyle(1);
var colors:Array = [0xffffff, 0xff0000];
var alphas:Array = [1, 1];
var ratios:Array = [0, 255];
var matrix:Matrix = new Matrix();
matrix.createGradientBox(100, 100, Math.PI / 4, 0, 0);
graphics.beginGradientFill( GradientType.RADIAL, colors, alphas, ratios, matrix);
graphics.drawRect(0, 0, 100, 100);
graphics.endFill();
}
}
}