0.5.0 • Published 4 months ago

luna-painter v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Luna Painter

Simple drawing tool.

Demo

https://luna.liriliri.io/?path=/story/painter

Install

Add the following script and style to your page.

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-toolbar/luna-toolbar.css" />
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-painter/luna-painter.css" />
<script src="//cdn.jsdelivr.net/npm/luna-toolbar/luna-toolbar.js"></script>
<script src="//cdn.jsdelivr.net/npm/luna-painter/luna-painter.js"></script>

You can also get it on npm.

npm install luna-painter luna-toolbar --save
import 'luna-toolbar/luna-toolbar.css'
import 'luna-painter/luna-painter.css'
import LunaPainter from 'luna-painter'

Usage

const container = document.getElementById('container')
const painer = new LunaPainter(container)

Configuration

  • height(number): Canvas height.
  • tool(string): Initial used tool.
  • width(number): Canvas width.

Api

addLayer(): number

Add layer.

getActiveLayer(): Layer

Get active layer.

getCurrentToolName(): string

Get current tool name.

getTool(name: string): void | LunaComponent

Get tool.

useTool(name: string): void

Use tool.

0.5.0

4 months ago

0.4.0

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago