GithubHelp home page GithubHelp logo

marlnox / fabricjs-layer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arch-inc/fabricjs-layer

0.0 0.0 0.0 2.8 MB

Fabric.js用のシンプルなレイヤー実装 / A simple layer implementation on top of Fabric.js

Home Page: https://arch-inc.github.io/fabricjs-layer/

License: Other

TypeScript 91.37% JavaScript 8.63%

fabricjs-layer's Introduction

fabricjs-layer

build npm version

fabricjs-layer is a simple layer implementation for Fabric.js v3.x and v4.x.

fabricjs-layer は Fabric.js v3.x および v4.x 用のシンプルなレイヤー実装です。

Usage / 使い方

<canvas id="main" width="720" height="480"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/3.6.2/fabric.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sortedindex@latest/dist/index.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@arch-inc/fabricjs-layer@latest/dist/index.js"></script>
<script>
  // Create a Fabric.js canvas
  let canvas = new fabric.Canvas(document.getElementById("main"), {
    isDrawingMode: true
  });

  // Create layer manager
  let manager = new fabricLayer.LayerManager(canvas);

  // Add layers
  for (let i = 0; i++; i < 5) {
    manager.addLayer();
  }

  // Set active layer
  manager.activeLayer = manager.getLayer(3);

  // Remove layer
  manager.removeLayer(manager.getLayer(2));

  // Move layer
  manager.moveLayer(manager.activeLayerIndex, manager.activeLayerIndex + 1);

  // Dispose layer manager
  manager.dispose();
</script>

If you use Webpack or other similar solutions, simply install the npm package and start using it.

TypeScript definitions are available by default. (e.g., Layer.d.ts)

Webpack 等を使っている場合は npm install でインストールできます。TypeScript の型定義がついてきます。

npm i @arch-inc/fabricjs-layer
import { LayerGroup } from "@arch-inc/fabricjs-layer";

API Documentation / API ドキュメント

All of the exported classes and interfaces are listed in TypeDoc.

このモジュールが export しているすべてのクラスとインタフェースは TypeDoc で閲覧できます。

Credits / 開発者

Staying in touch / 開発者に連絡

Library in action / 利用例

  • Demo site: GitHub Pages accompanied with this library

Copyright (c) 2020-2022 Arch Inc. (Jun Kato)

fabricjs-layer's People

Contributors

arcatdmz avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.