WindingDemo
/**
* Copyright fakestar0826 ( http://wonderfl.net/user/fakestar0826 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/4G2o
*/
// forked from fakestar0826's CurveDrawing
package {
import flash.display.GraphicsPathCommand;
import flash.display.GraphicsPathWinding;
import flash.display.Sprite;
public class FlashTest extends Sprite {
private var commands:Vector.<int> = new Vector.<int>();
private var data1:Vector.<Number> = new Vector.<Number>();
public function FlashTest() {
// write as3 code here..
commands.push(GraphicsPathCommand.MOVE_TO);
commands.push(GraphicsPathCommand.LINE_TO);
commands.push(GraphicsPathCommand.LINE_TO);
commands.push(GraphicsPathCommand.LINE_TO);
commands.push(GraphicsPathCommand.LINE_TO);
commands.push(GraphicsPathCommand.MOVE_TO);
commands.push(GraphicsPathCommand.LINE_TO);
commands.push(GraphicsPathCommand.LINE_TO);
commands.push(GraphicsPathCommand.LINE_TO);
commands.push(GraphicsPathCommand.LINE_TO);
data1.push(150, 100);
data1.push(200, 100);
data1.push(200, 250);
data1.push(150, 250);
data1.push(150, 100);
data1.push(100, 150);
data1.push(250, 150);//Windingを変える(ここと2つ下のポイントを変える)と塗りが変わる。
data1.push(250, 200);
data1.push(100, 200);//ここ。
data1.push(100, 150);
graphics.beginFill(0xFF0000);
graphics.drawPath(commands, data1, "nonZero");
graphics.endFill();
}
}
}