DIR : /home/kozerus/public_html/go/konva_path.html

/home/kozerus/public_html/go

Konva Path Demo
view raw

<!DOCTYPE html>
<html>
  <head>
    <script src="https://unpkg.com/konva@8.3.1/konva.min.js"></script>
    <meta charset="utf-8" />
    <title>Konva Path Demo</title>
    <style>
      body {
        margin: 0;
        padding: 0;
        overflow: hidden;
        background-color: #f0f0f0;
      }
    </style>
  </head>

  <body>
    <div id="container"></div>
    <script>
      var stage = new Konva.Stage({
        container: 'container',
        width: window.innerWidth,
        height: window.innerHeight,
      });

      var layer = new Konva.Layer();

      var path = new Konva.Path({
        x: 50,
        y: 40,
        data:
          'M12.582,9.551C3.251,16.237,0.921,29.021,7.08,38.564l-2.36,1.689l4.893,2.262l4.893,2.262l-0.568-5.36l-0.567-5.359l-2.365,1.694c-4.657-7.375-2.83-18.3.1,4.352-22.33c7.5.0.3.338,17.817-3.625,23.156,3.824c5.337,7.449,3.625,17.813-3.8.3.13.152l2.857,3.988c9.617-6.893,11.827-20.277,4.935-29.896C35.591,4.87,22.204,2.658,12.582,9.551z',
        fill: 'green',
        scale: {
          x: 2,
          y: 2,
        },
      });

      // add the shape to the layer
      layer.add(path);

      // add the layer to the stage
      stage.add(layer);
    </script>
  </body>
</html>
//


koh5_pano



Your browser does not support the HTML5 canvas element.


Drag mouse to navigate.

Navigation





17.Aug.2010, Martin Wengenmayer