My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Project Information
Members
Featured
Downloads
Links

'hXgraphix saves your lineTo's and beginFill's in swf format.'
It aims to provide the same set of methods as flash.display.Graphics
The output is a DefineShape swftag or swf file.
hXgraphix is written in haXe.(A compiled swc is available for AS3).

Supported drawing methods:

  • beginFill
  • beginGradientFill
  • beginBitmapFill
  • lineStyle

  • moveTo
  • lineTo
  • curveTo
  • endFill
  • endLine
  • clear
  • drawCircle
  • drawEllipse
  • drawRect
  • drawRoundRect
  • drawRoundRectComplex

Example(AS3):

package
{
	import HxGraphix;
	import flash.display.*;
	import flash.net.*;
	import flash.utils.*;

	public class Main extends Sprite
	{
		var _graphics:HxGraphix;

		public function Main()
		{
			_graphics = new HxGraphix();
			_graphics.lineStyle(3, 0x000000);
			_graphics.beginFill(0xff0000, 1);
			_graphics.drawRect(10,10,100,100);
			
			var swf = _graphics.getSWF();
			var bytes:ByteArray = swf.getData();
			
			//Save it as swf: (FP10)
			new FileReference().save(bytes, 'test.swf');
			
			//Display it:
			var loader:Loader=new Loader();
			loader.loadBytes(bytes);
			addChild(loader);
		}
	}
}

(More examples can be found in the downloads directory)

Powered by Google Project Hosting