novel_character_maker 0.1.3
novel_character_maker: ^0.1.3 copied to clipboard
A Flutter package for managing visual novel characters.
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 statechangeDirection(Direction direction): Flip character directionsetScale(double scale): Set character scalesetAnimationScale(double scale): Set animation scalesetWidgetSize(double size): Set widget size
CharacterWidget Class #
CharacterWidget(): Create with existing NovelCharacter instanceCharacterWidget.defaultCharacter(): Create with default statesCharacterWidget.fromJson(): Create from JSON configuration
Contributing #
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - 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