package examples { import com.transmote.flar.FLARMarker; import flash.display.Sprite; import flash.events.Event; import org.libspark.flartoolkit.core.types.FLARDoublePoint2d; /** * simple class to draw outlines around detected markers. * * @author Eric Socolofsky * @url http://transmote.com/flar */ public class MarkerOutliner extends Sprite { public function MarkerOutliner () { this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame); } public function drawOutline (marker:FLARMarker, downsampleRatio:Number, thickness:Number, color:Number) :void { this.graphics.lineStyle(thickness, color); var vertex:FLARDoublePoint2d = FLARDoublePoint2d(marker.outline.sqvertex[0]); this.graphics.moveTo(vertex.x/downsampleRatio, vertex.y/downsampleRatio); for (var i:uint=1; i