flame_sprite_fusion 0.1.3+1 copy "flame_sprite_fusion: ^0.1.3+1" to clipboard
flame_sprite_fusion: ^0.1.3+1 copied to clipboard

Sprite Fusion support for the Flame game engine. This package parses and renders tilemaps exported from Sprite Fusion tool.

example/lib/main.dart

import 'dart:async';

import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flame_sprite_fusion/flame_sprite_fusion.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: GameWidget.controlled(
        gameFactory: () => PlatformerGame(
          camera: CameraComponent.withFixedResolution(width: 320, height: 180),
        ),
      ),
    );
  }
}

class PlatformerGame extends FlameGame {
  PlatformerGame({super.camera});

  @override
  Color backgroundColor() => Colors.white70;

  @override
  Future<void> onLoad() async {
    final map = await SpriteFusionTilemapComponent.load(
      mapJsonFile: 'map.json',
      spriteSheetFile: 'spritesheet.png',
    );
    await world.add(map);

    camera.moveTo(map.size * 0.5);
  }
}
7
likes
160
pub points
67%
popularity

Publisher

verified publisherflame-engine.org

Sprite Fusion support for the Flame game engine. This package parses and renders tilemaps exported from Sprite Fusion tool.

Repository (GitHub)
View/report issues
Contributing

Topics

#flame #tilemap

Documentation

API reference

Funding

Consider supporting this project:

opencollective.com
github.com
patreon.com

License

MIT (license)

Dependencies

flame, flutter

More

Packages that depend on flame_sprite_fusion