fledge_yarn 0.3.1
fledge_yarn: ^0.3.1 copied to clipboard
Yarn Spinner dialogue system for the Fledge ECS game framework. Parse .yarn files and run interactive dialogues.
fledge_yarn #
Yarn Spinner dialogue system for Fledge games. Parse .yarn files and run interactive dialogues with branching narratives.
Installation #
dependencies:
fledge_yarn: ^0.2.1
Quick Start #
import 'package:fledge_ecs/fledge_ecs.dart';
import 'package:fledge_yarn/fledge_yarn.dart';
import 'package:flutter/services.dart';
Future<void> main() async {
final app = App()
..addPlugin(YarnPlugin())
..addPlugin(DialogueCorePlugin()); // event-driven dialogue layer
final project = app.world.getResource<YarnProject>()!;
project.parse(await rootBundle.loadString('assets/dialogue/npcs.yarn'));
app.world.eventWriter<DialogueStartRequested>().send(
const DialogueStartRequested('sara_greeting'),
);
await app.run();
}
DialogueCorePlugin adds a DialogueState resource, a set of request /
notification events, holding-command support (registerHoldingCommand),
and the DialogueBoxWidget — see the plugin docs for the full API.
Documentation #
See the Fledge documentation site for guides, API reference, and advanced usage.
License #
Apache 2.0 - See LICENSE for details.