flame_markdown 0.1.1+2 copy "flame_markdown: ^0.1.1+2" to clipboard
flame_markdown: ^0.1.1+2 copied to clipboard

Markdown support for the Flame game engine, bridging the markdown package into Flame's text rendering pipeline.

example/lib/main.dart

import 'dart:async';

import 'package:flame/components.dart';
import 'package:flame/flame.dart';
import 'package:flame/game.dart';
import 'package:flame/text.dart';
import 'package:flame_markdown/flame_markdown.dart';
import 'package:flutter/widgets.dart' hide Animation;

void main() {
  runApp(GameWidget(game: MarkdownGame()));
}

/// This example game showcases the use of the FlameMarkdown package
/// to render rich-text components using a simple markdown syntax.
class MarkdownGame extends FlameGame {
  @override
  Future<void> onLoad() async {
    final markdown = await Flame.assets.readFile('fire_and_ice.md');
    await add(
      TextElementComponent.fromDocument(
        document: FlameMarkdown.toDocument(markdown),
        style: DocumentStyle(
          padding: const EdgeInsets.all(16),
        ),
        size: size,
      ),
    );
    await super.onLoad();
  }
}
3
likes
0
pub points
70%
popularity

Publisher

verified publisherflame-engine.org

Markdown support for the Flame game engine, bridging the markdown package into Flame's text rendering pipeline.

Homepage
Repository (GitHub)
View/report issues

Funding

Consider supporting this project:

opencollective.com
github.com
patreon.com

License

unknown (license)

Dependencies

flame, flutter, markdown

More

Packages that depend on flame_markdown