title: Dashed strokes to draw polygons in p5.js
body: <p>I have a piece of code running with createjs. It draws the polygons to the canvas with dashed strokes and adjusts the offset every time so that the dashed strokes appear to be moving along a path. I am doing this with <code>setStrokeDash()</code> command in createjs. Is there any equivalent command which does the same thing in p5.js?
  The working code in createjs in given below:</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>&lt;head&gt;
      &lt;script src="easeljs-0.8.2.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
      var stage, polygon0 = false;
      var dashCmd;
  
      function init()
      {
           stage = new createjs.Stage("demoCanvas");          
  
           polygon0 = stage.addChild(new createjs.Shape());
           dashCmd = polygon0.graphics.setStrokeDash([7,3]).command;
  
           polygon0.graphics.beginStroke("black");
           polygon0.graphics.moveTo(508,564).lineTo(516,564).lineTo(775, 552).lineTo(508, 564);
  
           createjs.Ticker.timingMode = createjs.Ticker.RAF;
  
      }
  
      function tick(event)
      {
           dashCmd.offset++;
           stage.update(event);
      }
      &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onload="init();"&gt;
      &lt;canvas id="demoCanvas" width="1200" height="1200"&gt;&lt;/canvas&gt;
  &lt;/body&gt;
  </code></pre>