Skip to content

Commit

Permalink
refactor: Update flame_texturepacker's file structure (#3014)
Browse files Browse the repository at this point in the history
This update `flame_texturepacker` to follow the same directory structure
as we have in the rest of the packages.
  • Loading branch information
spydon committed Feb 4, 2024
1 parent 23cf8b9 commit 982f226
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
7 changes: 6 additions & 1 deletion packages/flame_texturepacker/README.md
Expand Up @@ -23,6 +23,11 @@ A flame plugin to import sprite sheets generated by [Gdx Texture Packer][2] and
<!-- markdownlint-disable-next-line MD002 -->
# flame_texturepacker

TexturePacker is a tool to create efficient sprite sheets. This plugin allows you to import sprite
sheets generated by TexturePacker into your Flame game.

Note: Rotated sprites are not currently supported.


## Install from Pub

Expand Down Expand Up @@ -62,7 +67,7 @@ If you are using file storage, grab your atlas file like this:

```Dart
final documentsPath = (await getApplicationDocumentsDirectory()).path;
final atlas = await fromAtlas("${documentsPath}/atlas_map.atlas", fromStorage: true);
final atlas = await fromAtlas('$documentsPath/atlas_map.atlas', fromStorage: true);
```

Get a list of sprites ordered by their index, you can use the list to generate an animation:
Expand Down
4 changes: 2 additions & 2 deletions packages/flame_texturepacker/lib/flame_texturepacker.dart
@@ -1,9 +1,9 @@
library flame_texturepacker;

import 'package:flame/game.dart';
import 'package:flame_texturepacker/atlas/texture_packer_atlas.dart';
import 'package:flame_texturepacker/src/texture_packer_atlas.dart';

export 'package:flame_texturepacker/atlas/model/texture_packer_sprite.dart';
export 'package:flame_texturepacker/src/texture_packer_sprite.dart';

extension TexturepackerLoader on Game {
/// Loads the specified pack file.
Expand Down
@@ -1,4 +1,4 @@
import 'package:flame_texturepacker/atlas/model/page.dart';
import 'package:flame_texturepacker/src/model/page.dart';

/// Represents a region within the texture packer atlas.
class Region {
Expand Down
Expand Up @@ -6,9 +6,9 @@ import 'dart:io';
import 'package:collection/collection.dart';
import 'package:flame/cache.dart';
import 'package:flame/flame.dart';
import 'package:flame_texturepacker/atlas/model/page.dart';
import 'package:flame_texturepacker/atlas/model/region.dart';
import 'package:flame_texturepacker/atlas/model/texture_packer_sprite.dart';
import 'package:flame_texturepacker/src/model/page.dart';
import 'package:flame_texturepacker/src/model/region.dart';
import 'package:flame_texturepacker/src/texture_packer_sprite.dart';
import 'package:flutter/painting.dart';

final _images = Images(prefix: 'assets/');
Expand Down
@@ -1,5 +1,5 @@
import 'package:flame/components.dart';
import 'package:flame_texturepacker/atlas/model/region.dart';
import 'package:flame_texturepacker/src/model/region.dart';

/// {@template _texture_packer_sprite}
/// A [Sprite] extracted from a texture packer file.
Expand Down

0 comments on commit 982f226

Please sign in to comment.