19 February 2008

ActionScript basic drawing classes

Janis Radins has been playing around with creating some basic ActionScript drawing classes available over LGPL licence to download. All classes are subclasses from Base.as class which gives basic functionality. Available are Ellipse.as class, Polygon.as class, Rectangle.as class, TransformMatrix.as class and Triangle.as.

Here is my first creation,

ActionScript drawing sample

along with the source code.

import com.jR.Drawing.Ellipse;
var myEllipse:Ellipse = new Ellipse(_root, 1);
myEllipse.autoClear = false;
myEllipse.radius = 50;
myEllipse.drawOutline({drawX:150, drawY:60});
myEllipse.drawY += 15;
myEllipse.drawOutline({radiusY:35});
myEllipse.drawY += 20;
myEllipse.drawOutline({radiusY:15});
myEllipse.drawY += 20;
myEllipse.drawOutline({radiusY:35});
myEllipse.drawY += 15;
myEllipse.drawOutline({radiusY:50});
myEllipse.drawY -= 35;
myEllipse.drawX -= 35;
myEllipse.drawOutline({radiusY:50});
myEllipse.drawX += 70;
myEllipse.drawOutline({radiusY:50});

If you find this interesting you are welcome to send your link / code / sample via flanture [at] gmail [dt] com or leave comment about it.

0 comments:

 

template by blogger templates