Novel Character Maker

A Flutter package for creating and managing animated characters in visual novels.

Features

  • 🎭 Multiple character states (default, smile, sad, angry, surprised, blink, wave, nod, shake head)
  • ↔️ Direction control (left/right)
  • 🎚️ Customizable scaling and animation parameters
  • 🖼️ Flexible image handling with multiple initialization options
  • 🎬 Built-in animation system with smooth transitions
  • 📦 JSON configuration support for character states
  • 🎨 Customizable widget size and background color

Installation

Add to your pubspec.yaml:

dependencies:
  novel_character_maker: ^0.1.0

Then run:

flutter pub get

Usage

Basic Usage

import 'package:novel_character_maker/novel_character_maker.dart';

final character = NovelCharacter(
  states: {
    CharacterState.defaultState: AssetImage('assets/default.png'),
    CharacterState.smile: AssetImage('assets/smile.png'),
  },
);

CharacterWidget(
  character: character,
  size: 200.0,
  backgroundColor: Colors.blue,
);

JSON Configuration

CharacterWidget.fromJson(
  json: {
    'defaultState': 'assets/default.png',
    'smile': 'assets/smile.png',
    'sad': 'assets/sad.png',
  },
);

Changing States

character.changeState(CharacterState.smile);
character.changeDirection(Direction.left);
character.setScale(1.5);

API Reference

NovelCharacter Class

  • changeState(CharacterState state): Change character's current state
  • changeDirection(Direction direction): Flip character direction
  • setScale(double scale): Set character scale
  • setAnimationScale(double scale): Set animation scale
  • setWidgetSize(double size): Set widget size

CharacterWidget Class

  • CharacterWidget(): Create with existing NovelCharacter instance
  • CharacterWidget.defaultCharacter(): Create with default states
  • CharacterWidget.fromJson(): Create from JSON configuration

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a pull request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Project Homepage: http://peegel.xyz

Project Repository: https://gitlab.com/Simirror/novel_character_maker.git