パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.1.1

rough

Rough は、ざらついた手書き風のスタイルで描画できるライブラリです

30日間ダウンロード
10
いいね数
32
Pub ポイント
40

パッケージをインストール

flutter pub add rough

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Rough は、Flutter ライブラリであり、開発者がアプリ内にざらついた、手書き風の絵を描くことを可能にします。実際の鉛筆やペンのスケッチの不完全さを再現し、デジタルアートがより自然で生々しい感じになるようにします。インタラクティブな描画機能、署名入力、アーティスティックな UI 要素に最適で、Rough は粗いエフェクトでライン、形状、テキストをレンダリングするためのシンプルな API を提供します。このライブラリは軽量であり、pub.dev を介して Flutter プロジェクトにシームレスに統合できます。

用途

  • 手書き風の注釈
  • デジタル署名の取得
  • 芸術的なUI要素
  • スケッチベースのインターフェース
  • インタラクティブホワイトボード

主な機能

  • 手描きラインのレンダリング
  • カスタマイズ可能な粗さ
  • 形状およびテキストのサポート
  • 軽量で簡単に統合可能
  • リアルタイムスケッチサポート

適している対象

  • 表現力豊かな描画ツールを求めるアプリ開発者
  • オーガニックなビジュアルを望むデザイナー
  • 描画機能を備えた教育アプリ
  • インタラクティブなスケッチのプロトタイピング

注意事項

  • 2D描画に制限
  • 高度な編集ツールなし
  • 複雑なシーンではパフォーマンスが異なる場合があります
  • 高精度のグラフィックスには適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Pub GitHub Release Date GitHub

Rough

Rough is a library that allows you draw in a sketchy, hand-drawn-like style. It's a direct port of Rough.js.

Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  rough: <latest_version>

Basic usage

Right now only drawing via canvas is supported. This is a basic documentation in case you want to play around with Rough. I can't ensure non-breaking changes of the library interface.

To draw a figure you have to:

  1. Create a DrawConfig object to determine how your drawing will look.
  2. Create a Filler to be used when drawing objects (you have to provide a configuration for the filling and a DrawConfig for the filling path).
  3. Create a Generator object using the created DrawConfig and Filler. This will define a drawing/filling style.
  4. Invoke the drawing method from the Generator to create a Drawable.
  5. Paint the Drawable in the canvas using the drawRough method extension for Canvas.

Here an example on how to draw a circle:

//Create a `DrawConfig` object.
DrawConfig myDrawConfig = DrawConfig.build(
  roughness: 3,
  curveStepCount: 14,
  maxRandomnessOffset: 3,
);

//Create a `Filler` with a configuration (we reuse the drawConfig in this case).
FillerConfig myFillerConfig = FillerConfig(
    hachureGap: 8,
    hachureAngle: -20,
    drawConfig: myDrawConfig,
);
Filler myFiller = ZigZagFiller(myFillerConfig);

//Create a `Generator` with the created `DrawConfig` and `Filler`
Generator generator = Generator(
  myDrawConfig,
  myFiller,
);

//4. Build a circle `Drawable`.
Drawable figure = generator.circle(200, 200, 320);

//5. Paint the `Drawable` in the canvas.
Canvas.drawRough(figure, pathPaint, fillPaint);

And this is the result:

Result

Both DrawConfig and FillerConfig will use default values for anything not specified.

Samples

Some screenshots of the example app:

Example 1 Example 2 Example 3 Example 4

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。