flame_texturepacker
所属分类:collect
开发工具:Dart
文件大小:0KB
下载次数:0
上传日期:2023-06-30 14:14:14
上 传 者:
sh-1993
说明: 火焰纹理封隔器,,
(flame_texturepacker,,)
文件列表:
.metadata (309, 2023-08-12)
CHANGELOG.md (117, 2023-08-12)
LICENSE (1070, 2023-08-12)
example/ (0, 2023-08-12)
example/.metadata (926, 2023-08-12)
example/analysis_options.yaml (1453, 2023-08-12)
example/android/ (0, 2023-08-12)
example/android/app/ (0, 2023-08-12)
example/android/app/build.gradle (1957, 2023-08-12)
example/android/app/src/ (0, 2023-08-12)
example/android/app/src/debug/ (0, 2023-08-12)
example/android/app/src/debug/AndroidManifest.xml (327, 2023-08-12)
example/android/app/src/main/ (0, 2023-08-12)
example/android/app/src/main/AndroidManifest.xml (1667, 2023-08-12)
example/android/app/src/main/kotlin/ (0, 2023-08-12)
example/android/app/src/main/kotlin/com/ (0, 2023-08-12)
example/android/app/src/main/kotlin/com/example/ (0, 2023-08-12)
example/android/app/src/main/kotlin/com/example/example/ (0, 2023-08-12)
example/android/app/src/main/kotlin/com/example/example/MainActivity.kt (124, 2023-08-12)
example/android/app/src/main/res/ (0, 2023-08-12)
example/android/app/src/main/res/drawable-v21/ (0, 2023-08-12)
example/android/app/src/main/res/drawable-v21/launch_background.xml (438, 2023-08-12)
example/android/app/src/main/res/drawable/ (0, 2023-08-12)
example/android/app/src/main/res/drawable/launch_background.xml (434, 2023-08-12)
example/android/app/src/main/res/mipmap-hdpi/ (0, 2023-08-12)
example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png (544, 2023-08-12)
example/android/app/src/main/res/mipmap-mdpi/ (0, 2023-08-12)
example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png (442, 2023-08-12)
example/android/app/src/main/res/mipmap-xhdpi/ (0, 2023-08-12)
example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png (721, 2023-08-12)
example/android/app/src/main/res/mipmap-xxhdpi/ (0, 2023-08-12)
example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png (1031, 2023-08-12)
example/android/app/src/main/res/mipmap-xxxhdpi/ (0, 2023-08-12)
example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png (1443, 2023-08-12)
example/android/app/src/main/res/values-night/ (0, 2023-08-12)
... ...
# flame_texturepacker
A flame plugin to import sprite sheets generated by [Gdx Texture Packer][2] and [Code and Web Texture Packer][1]
## Install from Dart Pub
Include the following to your pubspec.yaml file:
```yaml
dependencies:
flame_texturepacker: any
```
## Usage
Drop generated atlas file and sprite sheet images into the `assets/` and link the files in your `pubspec.yaml` file:
```yaml
assets:
- assets/spriteSheet.atlas
- assets/spriteSheet.png
```
Import the plugin like this:
`import 'package:flame_texturepacker/flame_texturepacker.dart';`
Load the TextureAtlas passing the path of the sprite sheet atlas file:
```Dart
final atlas = await fromAtlas('FlameAtlasMap.atlas');
```
Get a list of sprites ordered by their index, you can use the list to generate an animation:
```Dart
final spriteList = atlas.findSpritesByName('robot_walk');
final animation = SpriteAnimation.spriteList(
spriteList,
stepTime: 0.1,
loop: true,
);
```
Get individual sprites by name:
```Dart
final jumpSprite = atlas.findSpriteByName('robot_jump')!;
final fallSprite = atlas.findSpriteByName('robot_fall')!;
final idleSprite = atlas.findSpriteByName('robot_idle')!;
```
Full working example can be found in [example folder][3].
Note: Sprites used in this example can be found OpenGameArt [here][4].
[1]: https://www.codeandweb.com/texturepacker 'Code & Web Texture Packer'
[2]: https://github.com/crashinvaders/gdx-texture-packer-gui 'Gdx Texture Packer'
[3]: /example/lib/main.dart 'Full working example'
[4]: https://opengameart.org/content/toon-characters-1 'Robot sprite'
近期下载者:
相关文件:
收藏者: