node-i2djs
  • Introduction to node-i2djs
  • Getting Started
    • Installation
    • Quick Start CanvasLayer
    • Quick Start Canvas PDF Layer
    • Examples
  • API Reference
    • canvasLayer
    • canvasPdfLayer
    • Element API
    • Textures
    • Path
    • Join Action
  • Guide
    • Element types
    • Data Join-Actions
    • Canvas: Textures & Sprite animation
    • Canvas: Clipping, Masking, Pattern
Powered by GitBook
On this page
  1. API Reference

Path

The path is the most powerful element in a graphical context since it allows for the definition of any complex or basic shape. The Node-i2djs Path offers a set of methods for building or interpreting the path, following the SVG Path syntax definition.

It can be imported as below.

import {path} from 'node-i2djs';

API

Path Instance creation:

var pathInstance = i2d.path()

#.m(absoluteflag, point);

pathInstance.m(true, { x: 0, y: 0 })

#.h(absoluteflag, point);

pathInstance.h(true, { x: 100 });

#.v(absoluteflag, point);

pathInstance.v(true, { y: 100 })

#.l(absoluteflag, point);

pathInstance.l(true, {x : 100, y: 100 });

#.c(absoluteflag, ctrl1, ctrl2, point);

pathInstance.c(true, {x : 50, y: 0 }, {x : 0, y: 50 }, {x : 100, y: 100 });

#.q(absoluteflag, ctrl1, point);

pathInstance.q(true, {x : 0, y: 50 }, {x : 100, y: 100 });

#.s(absoluteflag, ctrl2, point);

pathInstance.s(true, {x : 50, y: 0 }, {x : 50, y: 0 }, {x : 100, y: 100 })

#.a(absoluteflag, rx, ry, xRotation, arcLargeFlag, sweepFlag, point);

pathInstance.a(true, 0, 0, 2.1, true, false, {x : 100, y: 100 });

#.z();

pathInstance.z();

#.parse(Pathstring);

pathInstance.parse("M150 0 L75 200 L225 200 Z");

#.fetchPathString();

pathInstance.fetchPathString();

#.getTotalLength();

#.getPointAtLength();

#.isValid();

PreviousTexturesNextJoin Action

Last updated 2 years ago