flame_texturepacker 2.0.0+1 copy "flame_texturepacker: ^2.0.0+1" to clipboard
flame_texturepacker: ^2.0.0+1 copied to clipboard

outdated

A simple plugin for Flame Engine to import spritesheets generated by the TexturePacker tool.

flame_texturepacker #

A flame plugin to import spritesheets generated by TexturePacker

Install from Dart Pub #

Include the following to your pubspec.yaml file:

dependencies:
  flame_texturepacker: any

Usage #

Drop generated spritesheet image into the assets/images/ folder and the spritesheet json into assets/ and link the files in your pubspec.yaml file:

assets:
   - assets/spritesheet.json
   - assets/images/spritesheet.png

import the plugin like this: import 'package:flame_texturepacker/flame_texturepacker.dart';

generate a list of Sprites from the provided spritesheet: List<Sprites> sprites = await TexturepackerLoader.fromJSONAtlas('spritesheet.png', 'spritesheet.json');

the list can be used to generate an Animation as well:

Animation anim = Animation.spriteList(
    sprites,
    stepTime: 0.1,
    loop: true,
);

Full working example can be found in example folder.

11
likes
0
pub points
80%
popularity

Publisher

verified publisherflame-engine.org

A simple plugin for Flame Engine to import spritesheets generated by the TexturePacker tool.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flame, flutter

More

Packages that depend on flame_texturepacker