Author Archives: Zevan

TextLineMetrics

CLICK HERE TO COPY
Actionscript:

var word:String = "TextLineMetrics are useful";

var letters:Array = word.split("");

 

var pre:TextField;

for (var i:int = 0; i<letters.length; i++){

    var t:TextField = new TextField();

    t.defaultTextFormat = new TextFormat("Arial", 40);

    t.autoSize = TextFieldAutoSize.LEFT;

    t.textColor = int(Math.random() * 0xFFFFFF);

    t.text = letters[i];

    if (pre){

        var metrics:TextLineMetrics = pre.getLineMetrics(0);

  [...]

Posted in string manipulation, strings | Tagged , , | 6 Comments

QuickBox2D Editor

When I first created QuickBox2D I simultaneously developed a simple editor to aid in the creation of complex simulations. The result is very alpha and should be used cautiously. There is no UI, it is entirely key controlled. It generates actionscript files that can be copy and pasted into working simulations. It also has a [...]

Posted in QuickBox2D | Tagged , , , , | 27 Comments

Gesture Capture Performance

I'll be doing a drawing performance using something I created called Gesture Capture tomorrow April 9th in Brooklyn at the former Engine Co. 212 firehouse. The performance will happen at random intervals between 6pm and 10pm. There will be two other performances going on by Julie Fotheringham, Vera Angelica and Zahava Rozman. Here is some [...]

Posted in Announcements | Tagged , , | 2 Comments

Relaxing with Sine and Cosine

Last night I wanted to play with sine and cosine waves so I created this snippet:
CLICK HERE TO COPY
Actionscript:

var wave:Number = 0;

addEventListener(Event.ENTER_FRAME, onLoop);

function onLoop(evt:Event):void {

       graphics.clear()

       graphics.lineStyle(0,0);

       var time:Number = (stage.stageWidth/2 - mouseX)/10

       for (var j:int = 0; j<100; j++){

               var [...]

Posted in Uncategorized | 4 Comments