From e94a7e82b1d733985eb11f637f1d45f532a3f635 Mon Sep 17 00:00:00 2001 From: Dmitry <76906744+s1r1m1r1@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:01:25 +0100 Subject: [PATCH 1/4] Refactor asset path resolution and loading in TexturePackerAtlas to correctly handle prefixes and different asset types. [#3844] --- .../lib/src/texture_packer_atlas.dart | 63 +++++++-- .../test/atlas_path_resolution_test.dart | 128 ++++++++++++++++++ 2 files changed, 181 insertions(+), 10 deletions(-) create mode 100644 packages/flame_texturepacker/test/atlas_path_resolution_test.dart diff --git a/packages/flame_texturepacker/lib/src/texture_packer_atlas.dart b/packages/flame_texturepacker/lib/src/texture_packer_atlas.dart index 80179fde838..fac8b6e4f03 100644 --- a/packages/flame_texturepacker/lib/src/texture_packer_atlas.dart +++ b/packages/flame_texturepacker/lib/src/texture_packer_atlas.dart @@ -188,7 +188,7 @@ Future _fromAssets( ); } on Exception catch (e, stack) { Error.throwWithStackTrace( - Exception('Error loading $assetsPrefix$path from assets: $e'), + Exception('Error loading $path (prefix: $assetsPrefix) from assets: $e'), stack, ); } @@ -240,12 +240,33 @@ Future _parse( final regions = []; var hasIndexes = false; - final fileContent = fromStorage - ? await XFile(path).readAsString() - : await (assets ?? Flame.assets).readFile( - '${assetsPrefix!}/$path', - package: package, - ); + final String fileContent; + if (fromStorage) { + fileContent = await XFile(path).readAsString(); + } else { + final prefix = (assetsPrefix ?? '').trim(); + var cleanPath = path.trim(); + + if (cleanPath.startsWith('/')) { + cleanPath = cleanPath.substring(1); + } + + String fullPath; + if (prefix.isEmpty) { + fullPath = cleanPath; + } else { + if (prefix.endsWith('/')) { + fullPath = '$prefix$cleanPath'; + } else { + fullPath = '$prefix/$cleanPath'; + } + } + + fileContent = await (assets ?? Flame.assets).readFile( + fullPath, + package: package, + ); + } final lines = LineSplitter.split( fileContent, @@ -261,6 +282,8 @@ Future _parse( fromStorage, images, package, + assetsPrefix: assetsPrefix, + assets: assets, ); pages.add(page); @@ -329,8 +352,10 @@ Future _parsePage( String path, bool fromStorage, Images images, - String? package, -) async { + String? package, { + String? assetsPrefix, + AssetsCache? assets, +}) async { final page = Page(); page.textureFile = lineQueue.removeFirst(); @@ -345,7 +370,25 @@ Future _parsePage( images.add(texturePath, image); page.texture = images.fromCache(texturePath); } else { - page.texture = await images.load(texturePath, package: package); + final prefix = (assetsPrefix ?? '').trim(); + var cleanPath = texturePath.trim(); + + if (cleanPath.startsWith('/')) { + cleanPath = cleanPath.substring(1); + } + + String fullTexturePath; + if (prefix.isEmpty) { + fullTexturePath = cleanPath; + } else { + if (prefix.endsWith('/')) { + fullTexturePath = '$prefix$cleanPath'; + } else { + fullTexturePath = '$prefix/$cleanPath'; + } + } + + page.texture = await images.load(fullTexturePath, package: package); } _parsePageProperties(lineQueue, page); diff --git a/packages/flame_texturepacker/test/atlas_path_resolution_test.dart b/packages/flame_texturepacker/test/atlas_path_resolution_test.dart new file mode 100644 index 00000000000..6ca85fce83c --- /dev/null +++ b/packages/flame_texturepacker/test/atlas_path_resolution_test.dart @@ -0,0 +1,128 @@ +import 'dart:ui' as ui; +import 'package:flame/cache.dart'; +import 'package:flame_texturepacker/flame_texturepacker.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; + +class _MockAssetBundle extends Mock implements AssetBundle {} + +class _MockImages extends Mock implements Images {} + +class FakeImage extends Mock implements ui.Image {} + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + + group('TexturePackerAtlas Path Resolution', () { + late _MockAssetBundle bundle; + late _MockImages images; + late String atlasContent; + + setUpAll(() { + registerFallbackValue(const Symbol('package')); + }); + + setUp(() { + bundle = _MockAssetBundle(); + images = _MockImages(); + atlasContent = ''' +test.png +size: 64, 64 +filter: Nearest, Nearest +repeat: none +sprite1 + bounds: 0, 0, 32, 32 +'''; + + // Mock loading the atlas file + when( + () => bundle.loadString(any(), cache: any(named: 'cache')), + ).thenAnswer((_) async => atlasContent); + + // Mock loading an image + when( + () => images.load(any(), package: any(named: 'package')), + ).thenAnswer((_) async => FakeImage()); + }); + + test('should resolve paths correctly with leading slashes', () async { + final assets = AssetsCache(bundle: bundle); + + await TexturePackerAtlas.load( + '/path/to/atlas_name.atlas', + assets: assets, + images: images, + ); + + // Verify it tried to load 'images/path/to/atlas.atlas' + // The leading slash in /path/to/atlas.atlas should be removed. + verify( + () => bundle.loadString( + 'assets/images/path/to/atlas_name.atlas', + cache: any(named: 'cache'), + ), + ).called(1); + }); + + test('should handle assetsPrefix WITH trailing slash', () async { + final assets = AssetsCache(bundle: bundle); + + await TexturePackerAtlas.load( + 'atlas_name.atlas', + assetsPrefix: 'custom/', + assets: assets, + images: images, + ); + + verify( + () => bundle.loadString( + 'assets/custom/atlas_name.atlas', + cache: any(named: 'cache'), + ), + ).called(1); + }); + + test('should handle assetsPrefix WITHOUT trailing slash', () async { + final assets = AssetsCache(bundle: bundle); + + await TexturePackerAtlas.load( + 'atlas_name.atlas', + assetsPrefix: 'custom', + assets: assets, + images: images, + ); + + verify( + () => bundle.loadString( + 'assets/custom/atlas_name.atlas', + cache: any(named: 'cache'), + ), + ).called(1); + }); + + test('should pass package parameter to AssetsCache and Images', () async { + final assets = AssetsCache(bundle: bundle); + + await TexturePackerAtlas.load( + 'atlas_name.atlas', + assets: assets, + images: images, + package: 'my_package', + ); + + // Verify bundle call includes the package-prefixed path + verify( + () => bundle.loadString( + 'packages/my_package/assets/images/atlas_name.atlas', + cache: any(named: 'cache'), + ), + ).called(1); + + // Verify images.load call also includes the package + verify( + () => images.load('images/test.png', package: 'my_package'), + ).called(1); + }); + }); +} From 81d2f612366f0c01511d44b1c9c850a18a4f0be9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 19:08:53 +0100 Subject: [PATCH 2/4] chore(release): Publish packages (#3846) Prepared all packages to be released to pub.dev Co-authored-by: github-actions[bot] --- CHANGELOG.md | 198 ++++++++++++++++++ doc/flame/examples/pubspec.yaml | 6 +- doc/tutorials/klondike/app/pubspec.yaml | 4 +- doc/tutorials/platformer/app/pubspec.yaml | 4 +- doc/tutorials/space_shooter/app/pubspec.yaml | 4 +- examples/games/crystal_ball/pubspec.yaml | 4 +- examples/games/padracing/pubspec.yaml | 6 +- examples/games/rogue_shooter/pubspec.yaml | 4 +- examples/games/trex/pubspec.yaml | 4 +- examples/pubspec.yaml | 22 +- packages/flame/CHANGELOG.md | 24 +++ packages/flame/example/pubspec.yaml | 4 +- packages/flame/pubspec.yaml | 6 +- packages/flame_3d/CHANGELOG.md | 8 + packages/flame_3d/example/pubspec.yaml | 8 +- packages/flame_3d/pubspec.yaml | 8 +- packages/flame_audio/CHANGELOG.md | 5 + packages/flame_audio/example/pubspec.yaml | 6 +- packages/flame_audio/pubspec.yaml | 6 +- packages/flame_behavior_tree/CHANGELOG.md | 4 + .../behavior_tree/CHANGELOG.md | 4 + .../behavior_tree/pubspec.yaml | 4 +- .../flame_behavior_tree/example/pubspec.yaml | 6 +- packages/flame_behavior_tree/pubspec.yaml | 10 +- packages/flame_behaviors/CHANGELOG.md | 4 + packages/flame_behaviors/example/pubspec.yaml | 6 +- packages/flame_behaviors/pubspec.yaml | 8 +- packages/flame_bloc/CHANGELOG.md | 4 + packages/flame_bloc/example/pubspec.yaml | 6 +- packages/flame_bloc/pubspec.yaml | 8 +- packages/flame_console/CHANGELOG.md | 4 + packages/flame_console/example/pubspec.yaml | 6 +- packages/flame_console/pubspec.yaml | 8 +- packages/flame_devtools/pubspec.yaml | 4 +- packages/flame_fire_atlas/CHANGELOG.md | 5 + .../flame_fire_atlas/example/pubspec.yaml | 6 +- packages/flame_fire_atlas/pubspec.yaml | 6 +- packages/flame_forge2d/CHANGELOG.md | 4 + packages/flame_forge2d/example/pubspec.yaml | 6 +- packages/flame_forge2d/pubspec.yaml | 8 +- packages/flame_isolate/CHANGELOG.md | 5 + packages/flame_isolate/example/pubspec.yaml | 6 +- packages/flame_isolate/pubspec.yaml | 8 +- packages/flame_jenny/jenny/CHANGELOG.md | 4 + packages/flame_jenny/jenny/pubspec.yaml | 4 +- packages/flame_jenny/pubspec.yaml | 6 +- packages/flame_kenney_xml/CHANGELOG.md | 5 + .../flame_kenney_xml/example/pubspec.yaml | 6 +- packages/flame_kenney_xml/pubspec.yaml | 6 +- packages/flame_lint/CHANGELOG.md | 4 + packages/flame_lint/pubspec.yaml | 2 +- packages/flame_lottie/CHANGELOG.md | 4 + packages/flame_lottie/example/pubspec.yaml | 6 +- packages/flame_lottie/pubspec.yaml | 8 +- packages/flame_markdown/CHANGELOG.md | 4 + packages/flame_markdown/example/pubspec.yaml | 6 +- packages/flame_markdown/pubspec.yaml | 6 +- packages/flame_network_assets/CHANGELOG.md | 4 + .../flame_network_assets/example/pubspec.yaml | 6 +- packages/flame_network_assets/pubspec.yaml | 6 +- packages/flame_noise/CHANGELOG.md | 5 + packages/flame_noise/pubspec.yaml | 8 +- packages/flame_oxygen/CHANGELOG.md | 4 + packages/flame_oxygen/example/pubspec.yaml | 6 +- packages/flame_oxygen/pubspec.yaml | 6 +- packages/flame_rive/CHANGELOG.md | 5 + packages/flame_rive/example/pubspec.yaml | 6 +- packages/flame_rive/pubspec.yaml | 8 +- packages/flame_riverpod/CHANGELOG.md | 4 + packages/flame_riverpod/example/pubspec.yaml | 6 +- packages/flame_riverpod/pubspec.yaml | 6 +- packages/flame_spine/CHANGELOG.md | 4 + packages/flame_spine/example/pubspec.yaml | 6 +- packages/flame_spine/pubspec.yaml | 6 +- packages/flame_splash_screen/CHANGELOG.md | 4 + .../flame_splash_screen/example/pubspec.yaml | 4 +- packages/flame_splash_screen/pubspec.yaml | 4 +- packages/flame_sprite_fusion/CHANGELOG.md | 5 + .../flame_sprite_fusion/example/pubspec.yaml | 6 +- packages/flame_sprite_fusion/pubspec.yaml | 8 +- .../flame_steering_behaviors/CHANGELOG.md | 4 + .../example/pubspec.yaml | 10 +- .../flame_steering_behaviors/pubspec.yaml | 10 +- packages/flame_studio/pubspec.yaml | 4 +- packages/flame_svg/CHANGELOG.md | 5 + packages/flame_svg/example/pubspec.yaml | 6 +- packages/flame_svg/pubspec.yaml | 6 +- packages/flame_test/CHANGELOG.md | 4 + packages/flame_test/example/pubspec.yaml | 6 +- packages/flame_test/pubspec.yaml | 6 +- packages/flame_texturepacker/CHANGELOG.md | 6 + .../flame_texturepacker/example/pubspec.yaml | 6 +- packages/flame_texturepacker/pubspec.yaml | 6 +- packages/flame_tiled/CHANGELOG.md | 7 + packages/flame_tiled/example/pubspec.yaml | 6 +- packages/flame_tiled/pubspec.yaml | 6 +- 96 files changed, 559 insertions(+), 208 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d86b01f25c..08137848fe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,204 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2026-03-06 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`behavior_tree` - `v0.1.5+1`](#behavior_tree---v0151) + - [`flame` - `v1.36.0`](#flame---v1360) + - [`flame_3d` - `v0.1.1+7`](#flame_3d---v0117) + - [`flame_audio` - `v2.12.0`](#flame_audio---v2120) + - [`flame_behavior_tree` - `v0.1.4+3`](#flame_behavior_tree---v0143) + - [`flame_behaviors` - `v1.3.4`](#flame_behaviors---v134) + - [`flame_bloc` - `v1.12.22`](#flame_bloc---v11222) + - [`flame_console` - `v0.1.2+17`](#flame_console---v01217) + - [`flame_fire_atlas` - `v1.8.16`](#flame_fire_atlas---v1816) + - [`flame_forge2d` - `v0.19.2+5`](#flame_forge2d---v01925) + - [`flame_isolate` - `v0.6.2+21`](#flame_isolate---v06221) + - [`flame_kenney_xml` - `v0.1.2`](#flame_kenney_xml---v012) + - [`flame_lint` - `v1.4.3`](#flame_lint---v143) + - [`flame_lottie` - `v0.4.2+21`](#flame_lottie---v04221) + - [`flame_markdown` - `v0.2.4+14`](#flame_markdown---v02414) + - [`flame_network_assets` - `v0.3.3+21`](#flame_network_assets---v03321) + - [`flame_noise` - `v0.3.2+21`](#flame_noise---v03221) + - [`flame_oxygen` - `v0.2.3+21`](#flame_oxygen---v02321) + - [`flame_rive` - `v1.11.0`](#flame_rive---v1110) + - [`flame_riverpod` - `v5.5.3`](#flame_riverpod---v553) + - [`flame_spine` - `v0.3.0+4`](#flame_spine---v0304) + - [`flame_splash_screen` - `v0.3.1+3`](#flame_splash_screen---v0313) + - [`flame_sprite_fusion` - `v0.2.3`](#flame_sprite_fusion---v023) + - [`flame_steering_behaviors` - `v0.2.1+4`](#flame_steering_behaviors---v0214) + - [`flame_svg` - `v1.12.0`](#flame_svg---v1120) + - [`flame_test` - `v2.2.3`](#flame_test---v223) + - [`flame_texturepacker` - `v5.1.0`](#flame_texturepacker---v510) + - [`flame_tiled` - `v3.1.0`](#flame_tiled---v310) + - [`jenny` - `v1.5.1`](#jenny---v151) + +--- + +#### `behavior_tree` - `v0.1.5+1` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame` - `v1.36.0` + + - **FIX**: Ray direction normalization drift issues ([#3841](https://github.com/flame-engine/flame/issues/3841)). ([b8e2bab5](https://github.com/flame-engine/flame/commit/b8e2bab58fbfb1b817dd294db3d2389097d31a2d)) + - **FIX**: Initialize center offset in `CircleComponent` ctor ([#3842](https://github.com/flame-engine/flame/issues/3842)). ([a0d2a5f3](https://github.com/flame-engine/flame/commit/a0d2a5f3a2db6ca2b0c25c93ca48fe12a4bdbc11)) + - **FIX**: Resolve `fontPackage` in `IconComponent` (`_rasterizeIcon`) ([#3838](https://github.com/flame-engine/flame/issues/3838)). ([cdb2a0dd](https://github.com/flame-engine/flame/commit/cdb2a0ddf8ec6db733c904696a17ceeaed2e7b5f)) + - **FIX**: Hitboxes now correctly account for parent scale and rotation ([#3834](https://github.com/flame-engine/flame/issues/3834)). ([57adcd60](https://github.com/flame-engine/flame/commit/57adcd60970efb2dbf4f52e396a4e78a51e47be8)) + - **FIX**: Make `buildContext` available during `onLoad` and `onMount` ([#3833](https://github.com/flame-engine/flame/issues/3833)). ([60bfcb30](https://github.com/flame-engine/flame/commit/60bfcb30e7751ee65caa6425d79bbd7bb82ae3ed)) + - **FIX**: Add CJK wrapping for `TextBoxComponent` ([#3830](https://github.com/flame-engine/flame/issues/3830)). ([7f41c261](https://github.com/flame-engine/flame/commit/7f41c2614e1669398bb08858df30270d75dced68)) + - **FIX**: Prevent removed children from being re-added when parent is moved ([#3824](https://github.com/flame-engine/flame/issues/3824)). ([8e77bc2d](https://github.com/flame-engine/flame/commit/8e77bc2d87300a52c03177fb187c4e35b810acc4)) + - **FIX**: Make `removeAll(children)` work in `onRemove` ([#3823](https://github.com/flame-engine/flame/issues/3823)). ([ff760230](https://github.com/flame-engine/flame/commit/ff760230881f2a27f9d3a9462fc831c460d7ffc3)) + - **FIX**: End active collisions in ShapeHitbox.onRemove to fix inconsistent isColliding ([#3821](https://github.com/flame-engine/flame/issues/3821)). ([bc81e7fd](https://github.com/flame-engine/flame/commit/bc81e7fd96c1ec5ffad210d6d027894f6faef77b)) + - **FIX**: Use scaledRadius for CircleHitbox collision detection ([#3808](https://github.com/flame-engine/flame/issues/3808)). ([3498c1e5](https://github.com/flame-engine/flame/commit/3498c1e565985ce7d12212e6a625f538da98c362)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Add `clampDouble` to `Vector2Extension` and its tests ([#3840](https://github.com/flame-engine/flame/issues/3840)). ([6c6ccf31](https://github.com/flame-engine/flame/commit/6c6ccf317f3f397edf30a61c90ed00d087a96e9a)) + - **FEAT**: Add `transformMatrix` setter to `Transform2D` ([#3836](https://github.com/flame-engine/flame/issues/3836)). ([957ff2e0](https://github.com/flame-engine/flame/commit/957ff2e085f03ab43f40f4213d94730b52e2cfc6)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + - **FEAT**: Propagate Flutter hot reload through the component tree ([#3828](https://github.com/flame-engine/flame/issues/3828)). ([c44643f1](https://github.com/flame-engine/flame/commit/c44643f1afdf9890d9890d6653f7429366e7f03b)) + - **FEAT**: Add an IconComponent that renders IconData ([#3820](https://github.com/flame-engine/flame/issues/3820)). ([97931a59](https://github.com/flame-engine/flame/commit/97931a59361c51c433d366fecb30b7867813c521)) + - **FEAT**: Add `dispose()` method to `FlameGame` ([#3825](https://github.com/flame-engine/flame/issues/3825)). ([aa5a27b7](https://github.com/flame-engine/flame/commit/aa5a27b791c4bd5a3ab64ee73b34feefedb8b210)) + - **FEAT**: Add object pooling support with `ComponentPool` ([#3816](https://github.com/flame-engine/flame/issues/3816)). ([46802fab](https://github.com/flame-engine/flame/commit/46802fab4705ae8d1ff2a61660b2d80450f6075e)) + - **FEAT**: Add opposite method to Anchor ([#3817](https://github.com/flame-engine/flame/issues/3817)). ([1ffd59f0](https://github.com/flame-engine/flame/commit/1ffd59f09f90d17980b70e494ce585d676888b57)) + - **FEAT**: HitTestBehavior for GameWidget ([#3815](https://github.com/flame-engine/flame/issues/3815)). ([b888d4e2](https://github.com/flame-engine/flame/commit/b888d4e2d7ea95694a0c5f83e2fa68f8cee67069)) + - **DOCS**: Document FlameGame generic type parameter ([#3822](https://github.com/flame-engine/flame/issues/3822)). ([00a66123](https://github.com/flame-engine/flame/commit/00a66123d84d305e66953f1a85e66c46c8e0c4fc)) + +#### `flame_3d` - `v0.1.1+7` + + - **FIX**(flame_3d): Use float for numLights uniform to fix GLES crash ([#3810](https://github.com/flame-engine/flame/issues/3810)). ([f241ebd6](https://github.com/flame-engine/flame/commit/f241ebd6d73caa43387972cffeb609af2909ac2f)) + - **FIX**(flame_3d): Fix alpha blend factors for transparent background compositing ([#3812](https://github.com/flame-engine/flame/issues/3812)). ([8d7212a1](https://github.com/flame-engine/flame/commit/8d7212a1c79d561330131ea794a0ed318c3945f8)) + - **FIX**(flame_3d): Remove duplicate baseColor multiply in ambient calculation ([#3814](https://github.com/flame-engine/flame/issues/3814)). ([080bde7f](https://github.com/flame-engine/flame/commit/080bde7f4c14c9f4f91e09d9bf6e737f75449351)) + - **FIX**: Use scaledRadius for CircleHitbox collision detection ([#3808](https://github.com/flame-engine/flame/issues/3808)). ([3498c1e5](https://github.com/flame-engine/flame/commit/3498c1e565985ce7d12212e6a625f538da98c362)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_audio` - `v2.12.0` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + +#### `flame_behavior_tree` - `v0.1.4+3` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_behaviors` - `v1.3.4` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_bloc` - `v1.12.22` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_console` - `v0.1.2+17` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_fire_atlas` - `v1.8.16` + + - **FIX**: Fix warnings on flame_fire_atlas.dart ([#3818](https://github.com/flame-engine/flame/issues/3818)). ([458a79a9](https://github.com/flame-engine/flame/commit/458a79a97d63d128ab127fc15616192114dc9448)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_forge2d` - `v0.19.2+5` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_isolate` - `v0.6.2+21` + + - **FIX**: Use scaledRadius for CircleHitbox collision detection ([#3808](https://github.com/flame-engine/flame/issues/3808)). ([3498c1e5](https://github.com/flame-engine/flame/commit/3498c1e565985ce7d12212e6a625f538da98c362)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_kenney_xml` - `v0.1.2` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + +#### `flame_lint` - `v1.4.3` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_lottie` - `v0.4.2+21` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_markdown` - `v0.2.4+14` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_network_assets` - `v0.3.3+21` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_noise` - `v0.3.2+21` + + - **FIX**: `NoiseEffectController` producing zero progress on some platforms ([#3831](https://github.com/flame-engine/flame/issues/3831)). ([5d88832f](https://github.com/flame-engine/flame/commit/5d88832fa522a6880beeecb617b565aebcb703e7)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_oxygen` - `v0.2.3+21` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_rive` - `v1.11.0` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Rive 0.14 support ([#3839](https://github.com/flame-engine/flame/issues/3839)). ([8b245181](https://github.com/flame-engine/flame/commit/8b2451813672c25d1783447b966fd2f739492b65)) + +#### `flame_riverpod` - `v5.5.3` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_spine` - `v0.3.0+4` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_splash_screen` - `v0.3.1+3` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_sprite_fusion` - `v0.2.3` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + +#### `flame_steering_behaviors` - `v0.2.1+4` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_svg` - `v1.12.0` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + +#### `flame_test` - `v2.2.3` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + +#### `flame_texturepacker` - `v5.1.0` + + - **REFACTOR**: Asset path resolution/loading in TexturePackerAtlas to correctly handle prefixes and different asset types. ([17fac08d](https://github.com/flame-engine/flame/commit/17fac08d8964991a421cde8f5dd1ace4dc4e9063)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + +#### `flame_tiled` - `v3.1.0` + + - **FIX**: Use resolved path when loading single-image tilesets ([#3826](https://github.com/flame-engine/flame/issues/3826)). ([bbdff923](https://github.com/flame-engine/flame/commit/bbdff9230f96ab18ee83a1a0ffab5b4d7f4a43bf)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Add dynamic layer opacity support to flame_tiled ([#3843](https://github.com/flame-engine/flame/issues/3843)). ([b1702997](https://github.com/flame-engine/flame/commit/b17029977b3c5890fe6794942a0553eb3f21ff8d)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + +#### `jenny` - `v1.5.1` + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + + ## 2026-02-11 ### Changes diff --git a/doc/flame/examples/pubspec.yaml b/doc/flame/examples/pubspec.yaml index 06811f2cd53..049ef2b87b7 100644 --- a/doc/flame/examples/pubspec.yaml +++ b/doc/flame/examples/pubspec.yaml @@ -9,15 +9,15 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 - flame_rive: ^1.10.23 + flame: ^1.36.0 + flame_rive: ^1.11.0 flutter: sdk: flutter flutter_shaders: web: ^1.1.0 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: shaders: diff --git a/doc/tutorials/klondike/app/pubspec.yaml b/doc/tutorials/klondike/app/pubspec.yaml index 2bf3af24e07..311a50d0c9f 100644 --- a/doc/tutorials/klondike/app/pubspec.yaml +++ b/doc/tutorials/klondike/app/pubspec.yaml @@ -8,13 +8,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter web: ^1.1.0 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: assets: diff --git a/doc/tutorials/platformer/app/pubspec.yaml b/doc/tutorials/platformer/app/pubspec.yaml index 1ada423bef5..d6923abca63 100644 --- a/doc/tutorials/platformer/app/pubspec.yaml +++ b/doc/tutorials/platformer/app/pubspec.yaml @@ -9,12 +9,12 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/doc/tutorials/space_shooter/app/pubspec.yaml b/doc/tutorials/space_shooter/app/pubspec.yaml index b61fdd7b5ec..0409e67e47a 100644 --- a/doc/tutorials/space_shooter/app/pubspec.yaml +++ b/doc/tutorials/space_shooter/app/pubspec.yaml @@ -10,13 +10,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter web: ^1.1.0 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/examples/games/crystal_ball/pubspec.yaml b/examples/games/crystal_ball/pubspec.yaml index 4307575ca1f..1b97cf2b4a5 100644 --- a/examples/games/crystal_ball/pubspec.yaml +++ b/examples/games/crystal_ball/pubspec.yaml @@ -9,12 +9,12 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: uses-material-design: true diff --git a/examples/games/padracing/pubspec.yaml b/examples/games/padracing/pubspec.yaml index 6433a2fde09..0fd1b48b067 100644 --- a/examples/games/padracing/pubspec.yaml +++ b/examples/games/padracing/pubspec.yaml @@ -9,15 +9,15 @@ environment: dependencies: collection: ^1.17.1 - flame: ^1.35.1 - flame_forge2d: ^0.19.2+4 + flame: ^1.36.0 + flame_forge2d: ^0.19.2+5 flutter: sdk: flutter google_fonts: ^8.0.2 url_launcher: ^6.1.11 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/examples/games/rogue_shooter/pubspec.yaml b/examples/games/rogue_shooter/pubspec.yaml index c7492043e9c..667f6a886a6 100644 --- a/examples/games/rogue_shooter/pubspec.yaml +++ b/examples/games/rogue_shooter/pubspec.yaml @@ -11,12 +11,12 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: assets: diff --git a/examples/games/trex/pubspec.yaml b/examples/games/trex/pubspec.yaml index b4c81cb9b7f..7f65527b5b1 100644 --- a/examples/games/trex/pubspec.yaml +++ b/examples/games/trex/pubspec.yaml @@ -12,12 +12,12 @@ environment: dependencies: collection: ^1.16.0 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: uses-material-design: true assets: diff --git a/examples/pubspec.yaml b/examples/pubspec.yaml index 38d2857ca20..fe4e9f615a9 100644 --- a/examples/pubspec.yaml +++ b/examples/pubspec.yaml @@ -13,19 +13,19 @@ environment: dependencies: crystal_ball: ^0.1.0 dashbook: ^0.1.16 - flame: ^1.35.1 - flame_audio: ^2.11.14 - flame_forge2d: ^0.19.2+4 - flame_isolate: ^0.6.2+20 - flame_lottie: ^0.4.2+20 - flame_noise: ^0.3.2+20 - flame_spine: ^0.3.0+3 - flame_svg: ^1.11.20 - flame_tiled: ^3.0.11 + flame: ^1.36.0 + flame_audio: ^2.12.0 + flame_forge2d: ^0.19.2+5 + flame_isolate: ^0.6.2+21 + flame_lottie: ^0.4.2+21 + flame_noise: ^0.3.2+21 + flame_spine: ^0.3.0+4 + flame_svg: ^1.12.0 + flame_tiled: ^3.1.0 flutter: sdk: flutter google_fonts: ^8.0.2 - jenny: ^1.5.0 + jenny: ^1.5.1 meta: ^1.12.0 padracing: ^1.0.0 provider: ^6.1.2 @@ -34,7 +34,7 @@ dependencies: web: ^1.1.0 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 test: any flutter: diff --git a/packages/flame/CHANGELOG.md b/packages/flame/CHANGELOG.md index 54d174aa9b3..ecdcd00e571 100644 --- a/packages/flame/CHANGELOG.md +++ b/packages/flame/CHANGELOG.md @@ -1,3 +1,27 @@ +## 1.36.0 + + - **FIX**: Ray direction normalization drift issues ([#3841](https://github.com/flame-engine/flame/issues/3841)). ([b8e2bab5](https://github.com/flame-engine/flame/commit/b8e2bab58fbfb1b817dd294db3d2389097d31a2d)) + - **FIX**: Initialize center offset in `CircleComponent` ctor ([#3842](https://github.com/flame-engine/flame/issues/3842)). ([a0d2a5f3](https://github.com/flame-engine/flame/commit/a0d2a5f3a2db6ca2b0c25c93ca48fe12a4bdbc11)) + - **FIX**: Resolve `fontPackage` in `IconComponent` (`_rasterizeIcon`) ([#3838](https://github.com/flame-engine/flame/issues/3838)). ([cdb2a0dd](https://github.com/flame-engine/flame/commit/cdb2a0ddf8ec6db733c904696a17ceeaed2e7b5f)) + - **FIX**: Hitboxes now correctly account for parent scale and rotation ([#3834](https://github.com/flame-engine/flame/issues/3834)). ([57adcd60](https://github.com/flame-engine/flame/commit/57adcd60970efb2dbf4f52e396a4e78a51e47be8)) + - **FIX**: Make `buildContext` available during `onLoad` and `onMount` ([#3833](https://github.com/flame-engine/flame/issues/3833)). ([60bfcb30](https://github.com/flame-engine/flame/commit/60bfcb30e7751ee65caa6425d79bbd7bb82ae3ed)) + - **FIX**: Add CJK wrapping for `TextBoxComponent` ([#3830](https://github.com/flame-engine/flame/issues/3830)). ([7f41c261](https://github.com/flame-engine/flame/commit/7f41c2614e1669398bb08858df30270d75dced68)) + - **FIX**: Prevent removed children from being re-added when parent is moved ([#3824](https://github.com/flame-engine/flame/issues/3824)). ([8e77bc2d](https://github.com/flame-engine/flame/commit/8e77bc2d87300a52c03177fb187c4e35b810acc4)) + - **FIX**: Make `removeAll(children)` work in `onRemove` ([#3823](https://github.com/flame-engine/flame/issues/3823)). ([ff760230](https://github.com/flame-engine/flame/commit/ff760230881f2a27f9d3a9462fc831c460d7ffc3)) + - **FIX**: End active collisions in ShapeHitbox.onRemove to fix inconsistent isColliding ([#3821](https://github.com/flame-engine/flame/issues/3821)). ([bc81e7fd](https://github.com/flame-engine/flame/commit/bc81e7fd96c1ec5ffad210d6d027894f6faef77b)) + - **FIX**: Use scaledRadius for CircleHitbox collision detection ([#3808](https://github.com/flame-engine/flame/issues/3808)). ([3498c1e5](https://github.com/flame-engine/flame/commit/3498c1e565985ce7d12212e6a625f538da98c362)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Add `clampDouble` to `Vector2Extension` and its tests ([#3840](https://github.com/flame-engine/flame/issues/3840)). ([6c6ccf31](https://github.com/flame-engine/flame/commit/6c6ccf317f3f397edf30a61c90ed00d087a96e9a)) + - **FEAT**: Add `transformMatrix` setter to `Transform2D` ([#3836](https://github.com/flame-engine/flame/issues/3836)). ([957ff2e0](https://github.com/flame-engine/flame/commit/957ff2e085f03ab43f40f4213d94730b52e2cfc6)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + - **FEAT**: Propagate Flutter hot reload through the component tree ([#3828](https://github.com/flame-engine/flame/issues/3828)). ([c44643f1](https://github.com/flame-engine/flame/commit/c44643f1afdf9890d9890d6653f7429366e7f03b)) + - **FEAT**: Add an IconComponent that renders IconData ([#3820](https://github.com/flame-engine/flame/issues/3820)). ([97931a59](https://github.com/flame-engine/flame/commit/97931a59361c51c433d366fecb30b7867813c521)) + - **FEAT**: Add `dispose()` method to `FlameGame` ([#3825](https://github.com/flame-engine/flame/issues/3825)). ([aa5a27b7](https://github.com/flame-engine/flame/commit/aa5a27b791c4bd5a3ab64ee73b34feefedb8b210)) + - **FEAT**: Add object pooling support with `ComponentPool` ([#3816](https://github.com/flame-engine/flame/issues/3816)). ([46802fab](https://github.com/flame-engine/flame/commit/46802fab4705ae8d1ff2a61660b2d80450f6075e)) + - **FEAT**: Add opposite method to Anchor ([#3817](https://github.com/flame-engine/flame/issues/3817)). ([1ffd59f0](https://github.com/flame-engine/flame/commit/1ffd59f09f90d17980b70e494ce585d676888b57)) + - **FEAT**: HitTestBehavior for GameWidget ([#3815](https://github.com/flame-engine/flame/issues/3815)). ([b888d4e2](https://github.com/flame-engine/flame/commit/b888d4e2d7ea95694a0c5f83e2fa68f8cee67069)) + - **DOCS**: Document FlameGame generic type parameter ([#3822](https://github.com/flame-engine/flame/issues/3822)). ([00a66123](https://github.com/flame-engine/flame/commit/00a66123d84d305e66953f1a85e66c46c8e0c4fc)) + ## 1.35.1 - **FIX**: Cancel taps that start inside the component and end outside ([#3805](https://github.com/flame-engine/flame/issues/3805)). ([ebcdb81c](https://github.com/flame-engine/flame/commit/ebcdb81c83b0aa23906d1c652bad2bfadd5add71)) diff --git a/packages/flame/example/pubspec.yaml b/packages/flame/example/pubspec.yaml index a4980552c95..c718621033b 100644 --- a/packages/flame/example/pubspec.yaml +++ b/packages/flame/example/pubspec.yaml @@ -9,11 +9,11 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame/pubspec.yaml b/packages/flame/pubspec.yaml index 508f4a9d629..fce81df86de 100644 --- a/packages/flame/pubspec.yaml +++ b/packages/flame/pubspec.yaml @@ -1,7 +1,7 @@ name: flame resolution: workspace description: A minimalist Flutter game engine, provides a nice set of somewhat independent modules you can choose from. -version: 1.35.1 +version: 1.36.0 homepage: https://github.com/flame-engine/flame funding: - https://opencollective.com/blue-fire @@ -29,8 +29,8 @@ dev_dependencies: benchmark_harness: ^2.3.1 canvas_test: ^0.2.0 dartdoc: ^9.0.0 - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_3d/CHANGELOG.md b/packages/flame_3d/CHANGELOG.md index c8423d52e50..63318c14e3b 100644 --- a/packages/flame_3d/CHANGELOG.md +++ b/packages/flame_3d/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.1.1+7 + + - **FIX**(flame_3d): Use float for numLights uniform to fix GLES crash ([#3810](https://github.com/flame-engine/flame/issues/3810)). ([f241ebd6](https://github.com/flame-engine/flame/commit/f241ebd6d73caa43387972cffeb609af2909ac2f)) + - **FIX**(flame_3d): Fix alpha blend factors for transparent background compositing ([#3812](https://github.com/flame-engine/flame/issues/3812)). ([8d7212a1](https://github.com/flame-engine/flame/commit/8d7212a1c79d561330131ea794a0ed318c3945f8)) + - **FIX**(flame_3d): Remove duplicate baseColor multiply in ambient calculation ([#3814](https://github.com/flame-engine/flame/issues/3814)). ([080bde7f](https://github.com/flame-engine/flame/commit/080bde7f4c14c9f4f91e09d9bf6e737f75449351)) + - **FIX**: Use scaledRadius for CircleHitbox collision detection ([#3808](https://github.com/flame-engine/flame/issues/3808)). ([3498c1e5](https://github.com/flame-engine/flame/commit/3498c1e565985ce7d12212e6a625f538da98c362)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.1.1+6 - Update a dependency to the latest release. diff --git a/packages/flame_3d/example/pubspec.yaml b/packages/flame_3d/example/pubspec.yaml index fec10ba17ea..573367cb5da 100644 --- a/packages/flame_3d/example/pubspec.yaml +++ b/packages/flame_3d/example/pubspec.yaml @@ -8,14 +8,14 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_3d: ^0.1.1+6 - flame_console: ^0.1.2+16 + flame: ^1.36.0 + flame_3d: ^0.1.1+7 + flame_console: ^0.1.2+17 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: uses-material-design: true diff --git a/packages/flame_3d/pubspec.yaml b/packages/flame_3d/pubspec.yaml index e731841b1dd..e7954b43072 100644 --- a/packages/flame_3d/pubspec.yaml +++ b/packages/flame_3d/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_3d resolution: workspace description: Experimental 3D support for the Flame Engine -version: 0.1.1+6 +version: 0.1.1+7 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_3d funding: - https://opencollective.com/blue-fire @@ -14,7 +14,7 @@ environment: dependencies: collection: ^1.19.1 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter flutter_gpu: @@ -24,8 +24,8 @@ dependencies: vector_math: ^2.1.4 dev_dependencies: - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter diff --git a/packages/flame_audio/CHANGELOG.md b/packages/flame_audio/CHANGELOG.md index 5e6347f8ee8..9a05b78ebc8 100644 --- a/packages/flame_audio/CHANGELOG.md +++ b/packages/flame_audio/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.12.0 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + ## 2.11.14 - Update a dependency to the latest release. diff --git a/packages/flame_audio/example/pubspec.yaml b/packages/flame_audio/example/pubspec.yaml index 66cfb387faf..77869bf222c 100644 --- a/packages/flame_audio/example/pubspec.yaml +++ b/packages/flame_audio/example/pubspec.yaml @@ -10,13 +10,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_audio: ^2.11.14 + flame: ^1.36.0 + flame_audio: ^2.12.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: assets: diff --git a/packages/flame_audio/pubspec.yaml b/packages/flame_audio/pubspec.yaml index e17e2a3ca4e..48530397ac4 100644 --- a/packages/flame_audio/pubspec.yaml +++ b/packages/flame_audio/pubspec.yaml @@ -2,7 +2,7 @@ name: flame_audio resolution: workspace description: | Audio support for the Flame game engine, basically a thin wrapper around the audioplayers package. -version: 2.11.14 +version: 2.12.0 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_audio funding: - https://opencollective.com/blue-fire @@ -18,14 +18,14 @@ environment: dependencies: audioplayers: ^6.2.0 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter synchronized: ^3.1.0 dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_behavior_tree/CHANGELOG.md b/packages/flame_behavior_tree/CHANGELOG.md index 4fb70a7f80f..cfdd88088ca 100644 --- a/packages/flame_behavior_tree/CHANGELOG.md +++ b/packages/flame_behavior_tree/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.4+3 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.1.4+2 - Update a dependency to the latest release. diff --git a/packages/flame_behavior_tree/behavior_tree/CHANGELOG.md b/packages/flame_behavior_tree/behavior_tree/CHANGELOG.md index 35da45eda08..b98f3c5a675 100644 --- a/packages/flame_behavior_tree/behavior_tree/CHANGELOG.md +++ b/packages/flame_behavior_tree/behavior_tree/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.5+1 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.1.5 - **FEAT**: Add `Blackboard` support for behavior trees ([#3756](https://github.com/flame-engine/flame/issues/3756)). ([955411d3](https://github.com/flame-engine/flame/commit/955411d34a6e85e25524b52938146578fa4aa3e3)) diff --git a/packages/flame_behavior_tree/behavior_tree/pubspec.yaml b/packages/flame_behavior_tree/behavior_tree/pubspec.yaml index cf7581a482f..46f07f661d2 100644 --- a/packages/flame_behavior_tree/behavior_tree/pubspec.yaml +++ b/packages/flame_behavior_tree/behavior_tree/pubspec.yaml @@ -1,7 +1,7 @@ name: behavior_tree resolution: workspace description: A behavior tree implementation written in Dart. This package is designed to be used for implementing AI in games. -version: 0.1.5 +version: 0.1.5+1 repository: https://github.com/flame-engine/flame/tree/main/packages/flame_behavior_tree/behavior_tree funding: - https://opencollective.com/blue-fire @@ -15,6 +15,6 @@ dependencies: meta: ^1.12.0 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 mocktail: ^1.0.4 test: any diff --git a/packages/flame_behavior_tree/example/pubspec.yaml b/packages/flame_behavior_tree/example/pubspec.yaml index e08b337dbc0..6c1fd18c3eb 100644 --- a/packages/flame_behavior_tree/example/pubspec.yaml +++ b/packages/flame_behavior_tree/example/pubspec.yaml @@ -12,13 +12,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_behavior_tree: ^0.1.4+2 + flame: ^1.36.0 + flame_behavior_tree: ^0.1.4+3 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_behavior_tree/pubspec.yaml b/packages/flame_behavior_tree/pubspec.yaml index 532681c22ce..b00e28679f1 100644 --- a/packages/flame_behavior_tree/pubspec.yaml +++ b/packages/flame_behavior_tree/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_behavior_tree resolution: workspace description: A bridge package that integrates behavior_tree package with flame. -version: 0.1.4+2 +version: 0.1.4+3 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_behavior_tree funding: - https://opencollective.com/blue-fire @@ -15,14 +15,14 @@ environment: flutter: ">=3.41.0" dependencies: - behavior_tree: ^0.1.5 - flame: ^1.35.1 + behavior_tree: ^0.1.5+1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_behaviors/CHANGELOG.md b/packages/flame_behaviors/CHANGELOG.md index 538e2c2b673..c8677f46707 100644 --- a/packages/flame_behaviors/CHANGELOG.md +++ b/packages/flame_behaviors/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.4 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 1.3.3 - Update a dependency to the latest release. diff --git a/packages/flame_behaviors/example/pubspec.yaml b/packages/flame_behaviors/example/pubspec.yaml index 95090d114eb..059d166cbfd 100644 --- a/packages/flame_behaviors/example/pubspec.yaml +++ b/packages/flame_behaviors/example/pubspec.yaml @@ -8,11 +8,11 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_behaviors: ^1.3.3 + flame: ^1.36.0 + flame_behaviors: ^1.3.4 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 diff --git a/packages/flame_behaviors/pubspec.yaml b/packages/flame_behaviors/pubspec.yaml index 878f69d8a88..59953accb1a 100644 --- a/packages/flame_behaviors/pubspec.yaml +++ b/packages/flame_behaviors/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_behaviors resolution: workspace description: Flame Behaviors applies separation of concerns to game logic in the form of Entities and Behaviors, originally built by Very Good Ventures. -version: 1.3.3 +version: 1.3.4 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_behaviors environment: @@ -9,13 +9,13 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter mocktail: ^1.0.4 \ No newline at end of file diff --git a/packages/flame_bloc/CHANGELOG.md b/packages/flame_bloc/CHANGELOG.md index 1289f10acce..4b6277328e1 100644 --- a/packages/flame_bloc/CHANGELOG.md +++ b/packages/flame_bloc/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.12.22 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 1.12.21 - Update a dependency to the latest release. diff --git a/packages/flame_bloc/example/pubspec.yaml b/packages/flame_bloc/example/pubspec.yaml index 9125ac70484..8ab3d2f8e8b 100644 --- a/packages/flame_bloc/example/pubspec.yaml +++ b/packages/flame_bloc/example/pubspec.yaml @@ -12,14 +12,14 @@ environment: dependencies: equatable: ^2.0.5 - flame: ^1.35.1 - flame_bloc: ^1.12.21 + flame: ^1.36.0 + flame_bloc: ^1.12.22 flutter: sdk: flutter flutter_bloc: ^8.1.2 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_bloc/pubspec.yaml b/packages/flame_bloc/pubspec.yaml index e8ba5fd909c..b130283edfa 100644 --- a/packages/flame_bloc/pubspec.yaml +++ b/packages/flame_bloc/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_bloc resolution: workspace description: Integration for the Bloc state management library to Flame games. -version: 1.12.21 +version: 1.12.22 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_bloc funding: - https://opencollective.com/blue-fire @@ -17,7 +17,7 @@ environment: dependencies: bloc: ">=8.1.1 <10.0.0" - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter flutter_bloc: ">=8.1.2 <10.0.0" @@ -25,8 +25,8 @@ dependencies: dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_console/CHANGELOG.md b/packages/flame_console/CHANGELOG.md index b1d647444b2..a3f4c9246b6 100644 --- a/packages/flame_console/CHANGELOG.md +++ b/packages/flame_console/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.2+17 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.1.2+16 - Update a dependency to the latest release. diff --git a/packages/flame_console/example/pubspec.yaml b/packages/flame_console/example/pubspec.yaml index b20873c56f6..fdfa42d3789 100644 --- a/packages/flame_console/example/pubspec.yaml +++ b/packages/flame_console/example/pubspec.yaml @@ -10,13 +10,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_console: ^0.1.2+16 + flame: ^1.36.0 + flame_console: ^0.1.2+17 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_console/pubspec.yaml b/packages/flame_console/pubspec.yaml index fbd2f44917a..cdda2a3e11e 100644 --- a/packages/flame_console/pubspec.yaml +++ b/packages/flame_console/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_console resolution: workspace description: "An extensible and customizable console to help debug Flame games." -version: 0.1.2+16 +version: 0.1.2+17 repository: https://github.com/flame-engine/flame/tree/main/packages/flame_console funding: - https://opencollective.com/blue-fire @@ -18,13 +18,13 @@ environment: dependencies: args: ^2.5.0 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter terminui: ^0.2.0 dev_dependencies: - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter diff --git a/packages/flame_devtools/pubspec.yaml b/packages/flame_devtools/pubspec.yaml index f2392016236..9af2f11c6ec 100644 --- a/packages/flame_devtools/pubspec.yaml +++ b/packages/flame_devtools/pubspec.yaml @@ -11,13 +11,13 @@ dependencies: animated_tree_view: ^2.3.0 devtools_app_shared: ^0.3.1 devtools_extensions: ^0.3.1 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter flutter_riverpod: ^3.0.3 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: uses-material-design: true diff --git a/packages/flame_fire_atlas/CHANGELOG.md b/packages/flame_fire_atlas/CHANGELOG.md index bc27d023e40..fa0be3895f6 100644 --- a/packages/flame_fire_atlas/CHANGELOG.md +++ b/packages/flame_fire_atlas/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.8.16 + + - **FIX**: Fix warnings on flame_fire_atlas.dart ([#3818](https://github.com/flame-engine/flame/issues/3818)). ([458a79a9](https://github.com/flame-engine/flame/commit/458a79a97d63d128ab127fc15616192114dc9448)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 1.8.15 - Update a dependency to the latest release. diff --git a/packages/flame_fire_atlas/example/pubspec.yaml b/packages/flame_fire_atlas/example/pubspec.yaml index 7ec9715899e..07f709a8a7c 100644 --- a/packages/flame_fire_atlas/example/pubspec.yaml +++ b/packages/flame_fire_atlas/example/pubspec.yaml @@ -10,13 +10,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_fire_atlas: ^1.8.15 + flame: ^1.36.0 + flame_fire_atlas: ^1.8.16 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_fire_atlas/pubspec.yaml b/packages/flame_fire_atlas/pubspec.yaml index e65f2ec6601..d6ccff42408 100644 --- a/packages/flame_fire_atlas/pubspec.yaml +++ b/packages/flame_fire_atlas/pubspec.yaml @@ -2,7 +2,7 @@ name: flame_fire_atlas resolution: workspace description: Easy to use texture atlases for the flame engine created with the fire atlas editor -version: 1.8.15 +version: 1.8.16 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_fire_atlas funding: - https://opencollective.com/blue-fire @@ -18,13 +18,13 @@ environment: dependencies: archive: ^4.0.2 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_forge2d/CHANGELOG.md b/packages/flame_forge2d/CHANGELOG.md index 4f1610ba257..74c63c2f728 100644 --- a/packages/flame_forge2d/CHANGELOG.md +++ b/packages/flame_forge2d/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.19.2+5 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.19.2+4 - Update a dependency to the latest release. diff --git a/packages/flame_forge2d/example/pubspec.yaml b/packages/flame_forge2d/example/pubspec.yaml index 3293fe8bdba..91b731f2557 100644 --- a/packages/flame_forge2d/example/pubspec.yaml +++ b/packages/flame_forge2d/example/pubspec.yaml @@ -11,13 +11,13 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 - flame_forge2d: ^0.19.2+4 + flame: ^1.36.0 + flame_forge2d: ^0.19.2+5 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_forge2d/pubspec.yaml b/packages/flame_forge2d/pubspec.yaml index d437d2432f8..43549a73394 100644 --- a/packages/flame_forge2d/pubspec.yaml +++ b/packages/flame_forge2d/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_forge2d resolution: workspace description: Forge2D (Box2D) support for the Flame game engine. This uses the forge2d package and provides wrappers and components to be used inside Flame. -version: 0.19.2+4 +version: 0.19.2+5 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_forge2d funding: - https://opencollective.com/blue-fire @@ -17,15 +17,15 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter forge2d: ^0.14.2 dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_isolate/CHANGELOG.md b/packages/flame_isolate/CHANGELOG.md index 174957c12a5..299e67dcde4 100644 --- a/packages/flame_isolate/CHANGELOG.md +++ b/packages/flame_isolate/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.6.2+21 + + - **FIX**: Use scaledRadius for CircleHitbox collision detection ([#3808](https://github.com/flame-engine/flame/issues/3808)). ([3498c1e5](https://github.com/flame-engine/flame/commit/3498c1e565985ce7d12212e6a625f538da98c362)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.6.2+20 - Update a dependency to the latest release. diff --git a/packages/flame_isolate/example/pubspec.yaml b/packages/flame_isolate/example/pubspec.yaml index d8562eb6ef3..e821ba1aa69 100755 --- a/packages/flame_isolate/example/pubspec.yaml +++ b/packages/flame_isolate/example/pubspec.yaml @@ -12,14 +12,14 @@ environment: dependencies: collection: ^1.18.0 - flame: ^1.35.1 - flame_isolate: ^0.6.2+20 + flame: ^1.36.0 + flame_isolate: ^0.6.2+21 flutter: sdk: flutter quiver: ^3.2.1 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: assets: - assets/images/ diff --git a/packages/flame_isolate/pubspec.yaml b/packages/flame_isolate/pubspec.yaml index 12a194140fb..7dfe179465a 100644 --- a/packages/flame_isolate/pubspec.yaml +++ b/packages/flame_isolate/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_isolate resolution: workspace description: Flame wrapper for integral_isolates making multi-threading easy in Flame -version: 0.6.2+20 +version: 0.6.2+21 repository: https://github.com/flame-engine/flame/blob/main/packages/flame_isolate topics: - flame @@ -12,14 +12,14 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter integral_isolates: ^0.5.1 dev_dependencies: - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter test: any diff --git a/packages/flame_jenny/jenny/CHANGELOG.md b/packages/flame_jenny/jenny/CHANGELOG.md index 7fae84a743c..7f0cc39fde8 100644 --- a/packages/flame_jenny/jenny/CHANGELOG.md +++ b/packages/flame_jenny/jenny/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.5.1 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 1.5.0 - **FEAT**: Expose additional flame_jenny Command classes ([#3641](https://github.com/flame-engine/flame/issues/3641)). ([8ef2587d](https://github.com/flame-engine/flame/commit/8ef2587de4a1bef1d745cc1f5a626a7e84c6230c)) diff --git a/packages/flame_jenny/jenny/pubspec.yaml b/packages/flame_jenny/jenny/pubspec.yaml index adf4293d134..c0fdd8cbd8b 100644 --- a/packages/flame_jenny/jenny/pubspec.yaml +++ b/packages/flame_jenny/jenny/pubspec.yaml @@ -1,7 +1,7 @@ name: jenny resolution: workspace description: YarnSpinner narrative game tools equivalent for Dart. -version: 1.5.0 +version: 1.5.1 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_jenny/jenny funding: - https://opencollective.com/blue-fire @@ -20,5 +20,5 @@ dependencies: dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 test: any diff --git a/packages/flame_jenny/pubspec.yaml b/packages/flame_jenny/pubspec.yaml index cd7e5e77f6a..13ca95ca20c 100644 --- a/packages/flame_jenny/pubspec.yaml +++ b/packages/flame_jenny/pubspec.yaml @@ -17,13 +17,13 @@ environment: dependencies: collection: ^1.17.1 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter - jenny: ^1.5.0 + jenny: ^1.5.1 meta: ^1.12.0 dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 test: any diff --git a/packages/flame_kenney_xml/CHANGELOG.md b/packages/flame_kenney_xml/CHANGELOG.md index ae0dd86ae0b..acbae33a757 100644 --- a/packages/flame_kenney_xml/CHANGELOG.md +++ b/packages/flame_kenney_xml/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.1.2 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + ## 0.1.1+20 - Update a dependency to the latest release. diff --git a/packages/flame_kenney_xml/example/pubspec.yaml b/packages/flame_kenney_xml/example/pubspec.yaml index 49fae6d7410..7604c6ac7c7 100644 --- a/packages/flame_kenney_xml/example/pubspec.yaml +++ b/packages/flame_kenney_xml/example/pubspec.yaml @@ -10,13 +10,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_kenney_xml: ^0.1.1+20 + flame: ^1.36.0 + flame_kenney_xml: ^0.1.2 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: assets: diff --git a/packages/flame_kenney_xml/pubspec.yaml b/packages/flame_kenney_xml/pubspec.yaml index 12da9f9376d..936647de765 100644 --- a/packages/flame_kenney_xml/pubspec.yaml +++ b/packages/flame_kenney_xml/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_kenney_xml resolution: workspace description: "Support for Kenney XML spritesheets for the Flame game engine. This package parses XML files produced by Kenney." -version: 0.1.1+20 +version: 0.1.2 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_kenney_xml funding: - https://opencollective.com/blue-fire @@ -18,14 +18,14 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter xml: ^6.5.0 dev_dependencies: build_runner: ^2.4.11 - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter mockito: ^5.4.4 diff --git a/packages/flame_lint/CHANGELOG.md b/packages/flame_lint/CHANGELOG.md index a30d8818f6c..7c88bafc9cc 100644 --- a/packages/flame_lint/CHANGELOG.md +++ b/packages/flame_lint/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.4.3 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 1.4.2 - **FIX**: Update flame_lint to use lints 6.0.0 ([#3612](https://github.com/flame-engine/flame/issues/3612)). ([ba5f6789](https://github.com/flame-engine/flame/commit/ba5f6789bed68e4cc7ca95584e35ed62d0111da2)) diff --git a/packages/flame_lint/pubspec.yaml b/packages/flame_lint/pubspec.yaml index 83daf0964c0..74e669bd415 100644 --- a/packages/flame_lint/pubspec.yaml +++ b/packages/flame_lint/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_lint resolution: workspace description: Flame lint package -version: 1.4.2 +version: 1.4.3 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_lint funding: - https://opencollective.com/blue-fire diff --git a/packages/flame_lottie/CHANGELOG.md b/packages/flame_lottie/CHANGELOG.md index 0da5c670e5b..8b44eb899bc 100644 --- a/packages/flame_lottie/CHANGELOG.md +++ b/packages/flame_lottie/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.4.2+21 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.4.2+20 - Update a dependency to the latest release. diff --git a/packages/flame_lottie/example/pubspec.yaml b/packages/flame_lottie/example/pubspec.yaml index 5be8977f0f9..367a9a2b84b 100644 --- a/packages/flame_lottie/example/pubspec.yaml +++ b/packages/flame_lottie/example/pubspec.yaml @@ -8,14 +8,14 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_lottie: ^0.4.2+20 + flame: ^1.36.0 + flame_lottie: ^0.4.2+21 flutter: sdk: flutter lottie: dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: uses-material-design: true diff --git a/packages/flame_lottie/pubspec.yaml b/packages/flame_lottie/pubspec.yaml index 8ac3161c489..b8c9eda84bf 100644 --- a/packages/flame_lottie/pubspec.yaml +++ b/packages/flame_lottie/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_lottie resolution: workspace description: Flame wrapper for Lottie by AirBnB. This package implements a bridge between Lottie and Flame, allowing to load and display Lottie animations. -version: 0.4.2+20 +version: 0.4.2+21 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_lottie funding: - https://opencollective.com/blue-fire @@ -17,13 +17,13 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter lottie: ^3.1.2 dev_dependencies: - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter diff --git a/packages/flame_markdown/CHANGELOG.md b/packages/flame_markdown/CHANGELOG.md index c8c7a654908..eaa653628dc 100644 --- a/packages/flame_markdown/CHANGELOG.md +++ b/packages/flame_markdown/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.4+14 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.2.4+13 - Update a dependency to the latest release. diff --git a/packages/flame_markdown/example/pubspec.yaml b/packages/flame_markdown/example/pubspec.yaml index 9820a322bae..f51b1bef3b6 100644 --- a/packages/flame_markdown/example/pubspec.yaml +++ b/packages/flame_markdown/example/pubspec.yaml @@ -8,14 +8,14 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_markdown: ^0.2.4+13 + flame: ^1.36.0 + flame_markdown: ^0.2.4+14 flutter: sdk: flutter markdown: ^7.3.0 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: uses-material-design: false diff --git a/packages/flame_markdown/pubspec.yaml b/packages/flame_markdown/pubspec.yaml index daa96ca7f39..1a6493a79a4 100644 --- a/packages/flame_markdown/pubspec.yaml +++ b/packages/flame_markdown/pubspec.yaml @@ -2,7 +2,7 @@ name: flame_markdown resolution: workspace description: | Markdown support for the Flame game engine, bridging the markdown package into Flame's text rendering pipeline. -version: 0.2.4+13 +version: 0.2.4+14 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_markdown funding: - https://opencollective.com/blue-fire @@ -17,13 +17,13 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter markdown: ^7.1.1 dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter \ No newline at end of file diff --git a/packages/flame_network_assets/CHANGELOG.md b/packages/flame_network_assets/CHANGELOG.md index 39bad6ce425..498678a4342 100644 --- a/packages/flame_network_assets/CHANGELOG.md +++ b/packages/flame_network_assets/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.3+21 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.3.3+20 - Update a dependency to the latest release. diff --git a/packages/flame_network_assets/example/pubspec.yaml b/packages/flame_network_assets/example/pubspec.yaml index 0b8121abb6b..2eb2d67977e 100644 --- a/packages/flame_network_assets/example/pubspec.yaml +++ b/packages/flame_network_assets/example/pubspec.yaml @@ -9,10 +9,10 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_network_assets: ^0.3.3+20 + flame: ^1.36.0 + flame_network_assets: ^0.3.3+21 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 diff --git a/packages/flame_network_assets/pubspec.yaml b/packages/flame_network_assets/pubspec.yaml index cc5b87f4f07..33d77ec88e7 100644 --- a/packages/flame_network_assets/pubspec.yaml +++ b/packages/flame_network_assets/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_network_assets resolution: workspace description: Network assets support for Flame. -version: 0.3.3+20 +version: 0.3.3+21 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_network_assets funding: - https://opencollective.com/blue-fire @@ -18,7 +18,7 @@ environment: dependencies: dev: ^1.0.0 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter http: ^1.2.1 @@ -27,7 +27,7 @@ dependencies: dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_noise/CHANGELOG.md b/packages/flame_noise/CHANGELOG.md index 0b42aeac84c..f399f4ac0c6 100644 --- a/packages/flame_noise/CHANGELOG.md +++ b/packages/flame_noise/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.3.2+21 + + - **FIX**: `NoiseEffectController` producing zero progress on some platforms ([#3831](https://github.com/flame-engine/flame/issues/3831)). ([5d88832f](https://github.com/flame-engine/flame/commit/5d88832fa522a6880beeecb617b565aebcb703e7)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.3.2+20 - Update a dependency to the latest release. diff --git a/packages/flame_noise/pubspec.yaml b/packages/flame_noise/pubspec.yaml index fb24a0458a8..fa14789644b 100644 --- a/packages/flame_noise/pubspec.yaml +++ b/packages/flame_noise/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_noise resolution: workspace description: Integrate the fast_noise package into Flame -version: 0.3.2+20 +version: 0.3.2+21 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_noise funding: - https://opencollective.com/blue-fire @@ -17,12 +17,12 @@ environment: dependencies: fast_noise: ^2.0.0 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 test: any \ No newline at end of file diff --git a/packages/flame_oxygen/CHANGELOG.md b/packages/flame_oxygen/CHANGELOG.md index e72e7389460..c0f435b2f1f 100644 --- a/packages/flame_oxygen/CHANGELOG.md +++ b/packages/flame_oxygen/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.3+21 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.2.3+20 - Update a dependency to the latest release. diff --git a/packages/flame_oxygen/example/pubspec.yaml b/packages/flame_oxygen/example/pubspec.yaml index 21e333f89dd..c6d26caa2bd 100644 --- a/packages/flame_oxygen/example/pubspec.yaml +++ b/packages/flame_oxygen/example/pubspec.yaml @@ -10,13 +10,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_oxygen: ^0.2.3+20 + flame: ^1.36.0 + flame_oxygen: ^0.2.3+21 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: uses-material-design: true assets: diff --git a/packages/flame_oxygen/pubspec.yaml b/packages/flame_oxygen/pubspec.yaml index 74e07c071c3..5a0fc6a42f2 100644 --- a/packages/flame_oxygen/pubspec.yaml +++ b/packages/flame_oxygen/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_oxygen resolution: workspace description: Integrate the Oxygen ECS with the Flame Engine. -version: 0.2.3+20 +version: 0.2.3+21 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_oxygen funding: - https://opencollective.com/blue-fire @@ -15,11 +15,11 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter oxygen: ^0.3.1 dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 \ No newline at end of file + flame_lint: ^1.4.3 \ No newline at end of file diff --git a/packages/flame_rive/CHANGELOG.md b/packages/flame_rive/CHANGELOG.md index f4dfc8ea34b..551a453725b 100644 --- a/packages/flame_rive/CHANGELOG.md +++ b/packages/flame_rive/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.11.0 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Rive 0.14 support ([#3839](https://github.com/flame-engine/flame/issues/3839)). ([8b245181](https://github.com/flame-engine/flame/commit/8b2451813672c25d1783447b966fd2f739492b65)) + ## 1.10.23 - Update a dependency to the latest release. diff --git a/packages/flame_rive/example/pubspec.yaml b/packages/flame_rive/example/pubspec.yaml index ee098638f43..42cdb13f464 100644 --- a/packages/flame_rive/example/pubspec.yaml +++ b/packages/flame_rive/example/pubspec.yaml @@ -8,14 +8,14 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_rive: ^1.10.23 + flame: ^1.36.0 + flame_rive: ^1.11.0 flutter: sdk: flutter rive: ^0.14.0 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_rive/pubspec.yaml b/packages/flame_rive/pubspec.yaml index f0a85bfd590..bb9bc62a88c 100644 --- a/packages/flame_rive/pubspec.yaml +++ b/packages/flame_rive/pubspec.yaml @@ -2,7 +2,7 @@ name: flame_rive resolution: workspace description: Rive support for the Flame game engine. This uses the rive package and provides wrappers and components to be used inside Flame. homepage: https://github.com/flame-engine/flame -version: 1.10.23 +version: 1.11.0 funding: - https://opencollective.com/blue-fire - https://github.com/sponsors/bluefireteam @@ -17,14 +17,14 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter rive: ^0.14.0 dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter diff --git a/packages/flame_riverpod/CHANGELOG.md b/packages/flame_riverpod/CHANGELOG.md index 6c20ba14ded..c33ab139181 100644 --- a/packages/flame_riverpod/CHANGELOG.md +++ b/packages/flame_riverpod/CHANGELOG.md @@ -1,3 +1,7 @@ +## 5.5.3 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 5.5.2 - Update a dependency to the latest release. diff --git a/packages/flame_riverpod/example/pubspec.yaml b/packages/flame_riverpod/example/pubspec.yaml index 187673c617a..debe0bd9c6e 100644 --- a/packages/flame_riverpod/example/pubspec.yaml +++ b/packages/flame_riverpod/example/pubspec.yaml @@ -6,14 +6,14 @@ version: 1.0.0+1 environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_riverpod: ^5.5.2 + flame: ^1.36.0 + flame_riverpod: ^5.5.3 flutter: sdk: flutter flutter_riverpod: ^3.0.3 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_riverpod/pubspec.yaml b/packages/flame_riverpod/pubspec.yaml index 25bc44064a6..dc3f9f795cb 100644 --- a/packages/flame_riverpod/pubspec.yaml +++ b/packages/flame_riverpod/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_riverpod resolution: workspace description: Helpers for using Riverpod - a reactive caching and data-binding framework, in conjunction with Flame. -version: 5.5.2 +version: 5.5.3 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_riverpod funding: - https://opencollective.com/blue-fire @@ -16,13 +16,13 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter flutter_riverpod: ^3.0.3 riverpod: ^3.0.3 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_spine/CHANGELOG.md b/packages/flame_spine/CHANGELOG.md index 587944b055c..9bb2aed309c 100644 --- a/packages/flame_spine/CHANGELOG.md +++ b/packages/flame_spine/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.0+4 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.3.0+3 - Update a dependency to the latest release. diff --git a/packages/flame_spine/example/pubspec.yaml b/packages/flame_spine/example/pubspec.yaml index ed55f58c50e..a6575dc4665 100644 --- a/packages/flame_spine/example/pubspec.yaml +++ b/packages/flame_spine/example/pubspec.yaml @@ -8,13 +8,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_spine: ^0.3.0+3 + flame: ^1.36.0 + flame_spine: ^0.3.0+4 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_spine/pubspec.yaml b/packages/flame_spine/pubspec.yaml index 684d9b3f72c..cc4134fd1de 100644 --- a/packages/flame_spine/pubspec.yaml +++ b/packages/flame_spine/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_spine resolution: workspace description: Spine support for the Flame game engine. This uses the spine_flutter package and provides wrappers and components to be used inside Flame. -version: 0.3.0+3 +version: 0.3.0+4 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_spine funding: - https://opencollective.com/blue-fire @@ -17,13 +17,13 @@ environment: dependencies: collection: ^1.17.1 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter spine_flutter: ^4.3.0 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter test: any diff --git a/packages/flame_splash_screen/CHANGELOG.md b/packages/flame_splash_screen/CHANGELOG.md index 07d513ac153..7210af23260 100644 --- a/packages/flame_splash_screen/CHANGELOG.md +++ b/packages/flame_splash_screen/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.3.1+3 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.3.1+2 - **DOCS**: Fix workflow status badge paths ([#3517](https://github.com/flame-engine/flame/issues/3517)). ([149f16fe](https://github.com/flame-engine/flame/commit/149f16fe29f1fb14b3612964b2226c9c5c7daf95)) diff --git a/packages/flame_splash_screen/example/pubspec.yaml b/packages/flame_splash_screen/example/pubspec.yaml index 986245b5b83..0549e5db210 100644 --- a/packages/flame_splash_screen/example/pubspec.yaml +++ b/packages/flame_splash_screen/example/pubspec.yaml @@ -10,12 +10,12 @@ environment: flutter: ">=3.41.0" dependencies: - flame_splash_screen: ^0.3.1+2 + flame_splash_screen: ^0.3.1+3 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_splash_screen/pubspec.yaml b/packages/flame_splash_screen/pubspec.yaml index 284bec135a1..b07139c2465 100644 --- a/packages/flame_splash_screen/pubspec.yaml +++ b/packages/flame_splash_screen/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_splash_screen resolution: workspace description: Style your flame game with a beautiful splash screen with logo reveal. Simple to use but still customizable. -version: 0.3.1+2 +version: 0.3.1+3 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_splash_screen funding: - https://opencollective.com/blue-fire @@ -20,7 +20,7 @@ dependencies: meta: ^1.12.0 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter mockito: ^5.4.2 diff --git a/packages/flame_sprite_fusion/CHANGELOG.md b/packages/flame_sprite_fusion/CHANGELOG.md index 3d951578bde..df2b5d8a0d0 100644 --- a/packages/flame_sprite_fusion/CHANGELOG.md +++ b/packages/flame_sprite_fusion/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.2.3 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + ## 0.2.2+3 - Update a dependency to the latest release. diff --git a/packages/flame_sprite_fusion/example/pubspec.yaml b/packages/flame_sprite_fusion/example/pubspec.yaml index 33b6f3f548a..e8d0c57ac46 100644 --- a/packages/flame_sprite_fusion/example/pubspec.yaml +++ b/packages/flame_sprite_fusion/example/pubspec.yaml @@ -10,13 +10,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_sprite_fusion: ^0.2.2+3 + flame: ^1.36.0 + flame_sprite_fusion: ^0.2.3 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: uses-material-design: true diff --git a/packages/flame_sprite_fusion/pubspec.yaml b/packages/flame_sprite_fusion/pubspec.yaml index a09641b3651..f9b4e2c4160 100644 --- a/packages/flame_sprite_fusion/pubspec.yaml +++ b/packages/flame_sprite_fusion/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_sprite_fusion resolution: workspace description: "Sprite Fusion support for the Flame game engine. This package parses and renders tilemaps exported from Sprite Fusion tool." -version: 0.2.2+3 +version: 0.2.3 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_sprite_fusion funding: - https://opencollective.com/blue-fire @@ -17,12 +17,12 @@ environment: dependencies: collection: ^1.19.1 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter diff --git a/packages/flame_steering_behaviors/CHANGELOG.md b/packages/flame_steering_behaviors/CHANGELOG.md index b9bfd20598c..2915a3592a3 100644 --- a/packages/flame_steering_behaviors/CHANGELOG.md +++ b/packages/flame_steering_behaviors/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.1+4 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 0.2.1+3 - Update a dependency to the latest release. diff --git a/packages/flame_steering_behaviors/example/pubspec.yaml b/packages/flame_steering_behaviors/example/pubspec.yaml index 0a67de85b78..1342bcea82e 100644 --- a/packages/flame_steering_behaviors/example/pubspec.yaml +++ b/packages/flame_steering_behaviors/example/pubspec.yaml @@ -8,15 +8,15 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_behaviors: ^1.3.3 - flame_steering_behaviors: ^0.2.1+3 + flame: ^1.36.0 + flame_behaviors: ^1.3.4 + flame_steering_behaviors: ^0.2.1+4 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_steering_behaviors/pubspec.yaml b/packages/flame_steering_behaviors/pubspec.yaml index 93f8e7b38ab..3d2aa8d6d44 100644 --- a/packages/flame_steering_behaviors/pubspec.yaml +++ b/packages/flame_steering_behaviors/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_steering_behaviors resolution: workspace description: Flame Steering Behaviors brings steering algorithms to the behavior pattern, originally built by Very Good Ventures. -version: 0.2.1+3 +version: 0.2.1+4 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_steering_behaviors environment: @@ -9,14 +9,14 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 - flame_behaviors: ^1.3.3 + flame: ^1.36.0 + flame_behaviors: ^1.3.4 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_studio/pubspec.yaml b/packages/flame_studio/pubspec.yaml index 76334c00fee..8d0c0f4ba60 100644 --- a/packages/flame_studio/pubspec.yaml +++ b/packages/flame_studio/pubspec.yaml @@ -15,14 +15,14 @@ environment: dependencies: collection: ^1.17.1 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter flutter_riverpod: ^3.0.3 meta: ^1.12.0 dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter test: any diff --git a/packages/flame_svg/CHANGELOG.md b/packages/flame_svg/CHANGELOG.md index d302c31acfd..53faa052efb 100644 --- a/packages/flame_svg/CHANGELOG.md +++ b/packages/flame_svg/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.12.0 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + ## 1.11.20 - Update a dependency to the latest release. diff --git a/packages/flame_svg/example/pubspec.yaml b/packages/flame_svg/example/pubspec.yaml index 7cbc3c3d4aa..3615f213ce6 100644 --- a/packages/flame_svg/example/pubspec.yaml +++ b/packages/flame_svg/example/pubspec.yaml @@ -10,13 +10,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_svg: ^1.11.20 + flame: ^1.36.0 + flame_svg: ^1.12.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter diff --git a/packages/flame_svg/pubspec.yaml b/packages/flame_svg/pubspec.yaml index a111928e038..57250d5562a 100644 --- a/packages/flame_svg/pubspec.yaml +++ b/packages/flame_svg/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_svg resolution: workspace description: Package to add SVG rendering support for the Flame game engine -version: 1.11.20 +version: 1.12.0 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_svg funding: - https://opencollective.com/blue-fire @@ -17,14 +17,14 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter flutter_svg: ^2.0.5 dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_test/CHANGELOG.md b/packages/flame_test/CHANGELOG.md index 845982054a7..bf4fc6da092 100644 --- a/packages/flame_test/CHANGELOG.md +++ b/packages/flame_test/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.2.3 + + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + ## 2.2.2 - Update a dependency to the latest release. diff --git a/packages/flame_test/example/pubspec.yaml b/packages/flame_test/example/pubspec.yaml index 5bec113a746..eceea3ff5e1 100644 --- a/packages/flame_test/example/pubspec.yaml +++ b/packages/flame_test/example/pubspec.yaml @@ -9,13 +9,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 - flame_test: ^2.2.2 + flame_lint: ^1.4.3 + flame_test: ^2.2.3 flutter_test: sdk: flutter test: any diff --git a/packages/flame_test/pubspec.yaml b/packages/flame_test/pubspec.yaml index ca73bb20fd0..44c25753e53 100644 --- a/packages/flame_test/pubspec.yaml +++ b/packages/flame_test/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_test resolution: workspace description: A package with classes to help testing applications using Flame -version: 2.2.2 +version: 2.2.3 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_test funding: - https://opencollective.com/blue-fire @@ -17,7 +17,7 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter flutter_test: @@ -29,4 +29,4 @@ dependencies: dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 \ No newline at end of file + flame_lint: ^1.4.3 \ No newline at end of file diff --git a/packages/flame_texturepacker/CHANGELOG.md b/packages/flame_texturepacker/CHANGELOG.md index 343c9aa1f82..5642fbfd562 100644 --- a/packages/flame_texturepacker/CHANGELOG.md +++ b/packages/flame_texturepacker/CHANGELOG.md @@ -1,3 +1,9 @@ +## 5.1.0 + + - **REFACTOR**: Asset path resolution/loading in TexturePackerAtlas to correctly handle prefixes and different asset types. ([17fac08d](https://github.com/flame-engine/flame/commit/17fac08d8964991a421cde8f5dd1ace4dc4e9063)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + ## 5.0.5 - Update a dependency to the latest release. diff --git a/packages/flame_texturepacker/example/pubspec.yaml b/packages/flame_texturepacker/example/pubspec.yaml index ee97db64af8..367744e50a9 100644 --- a/packages/flame_texturepacker/example/pubspec.yaml +++ b/packages/flame_texturepacker/example/pubspec.yaml @@ -9,13 +9,13 @@ environment: flutter: ">=3.41.0" dependencies: - flame: ^1.35.1 - flame_texturepacker: ^5.0.5 + flame: ^1.36.0 + flame_texturepacker: ^5.1.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: assets: diff --git a/packages/flame_texturepacker/pubspec.yaml b/packages/flame_texturepacker/pubspec.yaml index ad238c4e363..5e05cecea88 100644 --- a/packages/flame_texturepacker/pubspec.yaml +++ b/packages/flame_texturepacker/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_texturepacker resolution: workspace description: A simple plugin for the Flame Engine to import spritesheets generated by the TexturePacker tool. -version: 5.0.5 +version: 5.1.0 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_texturepacker funding: - https://opencollective.com/blue-fire @@ -18,12 +18,12 @@ environment: dependencies: collection: ^1.17.1 cross_file: ^0.3.4+2 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter mocktail: ^1.0.4 diff --git a/packages/flame_tiled/CHANGELOG.md b/packages/flame_tiled/CHANGELOG.md index 3113be46057..9654a486699 100644 --- a/packages/flame_tiled/CHANGELOG.md +++ b/packages/flame_tiled/CHANGELOG.md @@ -1,3 +1,10 @@ +## 3.1.0 + + - **FIX**: Use resolved path when loading single-image tilesets ([#3826](https://github.com/flame-engine/flame/issues/3826)). ([bbdff923](https://github.com/flame-engine/flame/commit/bbdff9230f96ab18ee83a1a0ffab5b4d7f4a43bf)) + - **FIX**: Bump Flutter min version to 3.41.0 ([#3807](https://github.com/flame-engine/flame/issues/3807)). ([0d505304](https://github.com/flame-engine/flame/commit/0d50530485e5be9ce1c9138a5b437607c7c5c628)) + - **FEAT**: Add dynamic layer opacity support to flame_tiled ([#3843](https://github.com/flame-engine/flame/issues/3843)). ([b1702997](https://github.com/flame-engine/flame/commit/b17029977b3c5890fe6794942a0553eb3f21ff8d)) + - **FEAT**: Support package argument in asset loading methods and widgets ([#3835](https://github.com/flame-engine/flame/issues/3835)). ([3f6f95b0](https://github.com/flame-engine/flame/commit/3f6f95b0225df9e4035c74de6cfad501e8c45167)) + ## 3.0.11 - Update a dependency to the latest release. diff --git a/packages/flame_tiled/example/pubspec.yaml b/packages/flame_tiled/example/pubspec.yaml index f4897480e06..66e10e387e3 100644 --- a/packages/flame_tiled/example/pubspec.yaml +++ b/packages/flame_tiled/example/pubspec.yaml @@ -8,13 +8,13 @@ environment: sdk: ">=3.11.0 <4.0.0" dependencies: - flame: ^1.35.1 - flame_tiled: ^3.0.11 + flame: ^1.36.0 + flame_tiled: ^3.1.0 flutter: sdk: flutter dev_dependencies: - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter: uses-material-design: true assets: diff --git a/packages/flame_tiled/pubspec.yaml b/packages/flame_tiled/pubspec.yaml index cc89cf18515..5af8c33a5a9 100644 --- a/packages/flame_tiled/pubspec.yaml +++ b/packages/flame_tiled/pubspec.yaml @@ -1,7 +1,7 @@ name: flame_tiled resolution: workspace description: Tiled support for the Flame game engine. This uses the tiled package and provides wrappers and components to be used inside Flame. -version: 3.0.11 +version: 3.1.0 homepage: https://github.com/flame-engine/flame/tree/main/packages/flame_tiled funding: - https://opencollective.com/blue-fire @@ -18,7 +18,7 @@ environment: dependencies: collection: ^1.17.1 - flame: ^1.35.1 + flame: ^1.36.0 flutter: sdk: flutter meta: ^1.12.0 @@ -27,7 +27,7 @@ dependencies: dev_dependencies: dartdoc: ^9.0.0 - flame_lint: ^1.4.2 + flame_lint: ^1.4.3 flutter_test: sdk: flutter test: any From b0c4900e75b6d7dc5b1061af35e509b366fa868a Mon Sep 17 00:00:00 2001 From: Dmitry <76906744+s1r1m1r1@users.noreply.github.com> Date: Fri, 6 Mar 2026 20:47:59 +0100 Subject: [PATCH 3/4] fix(texturepacker): improve path resolution and region parsing #3848 --- .../lib/src/texture_packer_atlas.dart | 100 +++++++++++++++++- packages/flame_texturepacker/pubspec.yaml | 2 +- .../test/atlas_path_resolution_test.dart | 61 +++++++++++ 3 files changed, 157 insertions(+), 6 deletions(-) diff --git a/packages/flame_texturepacker/lib/src/texture_packer_atlas.dart b/packages/flame_texturepacker/lib/src/texture_packer_atlas.dart index fac8b6e4f03..39e75934756 100644 --- a/packages/flame_texturepacker/lib/src/texture_packer_atlas.dart +++ b/packages/flame_texturepacker/lib/src/texture_packer_atlas.dart @@ -262,9 +262,31 @@ Future _parse( } } + var currentPackage = package; + var finalPath = fullPath; + + // Check for package path in the full path (which may already include assetsPrefix) + const packageKeyword = 'packages/'; + final packageIndex = finalPath.indexOf(packageKeyword); + if (packageIndex != -1) { + final subPath = finalPath.substring(packageIndex + packageKeyword.length); + final parts = subPath.split('/'); + if (parts.length > 1) { + currentPackage ??= parts[0]; + // Clean the path by removing everything up to and including the package name + finalPath = parts.sublist(1).join('/'); + } + } + + // AssetsCache also prepends its own prefix (usually 'assets/') + final assetsCachePrefix = (assets ?? Flame.assets).prefix; + if (finalPath.startsWith(assetsCachePrefix)) { + finalPath = finalPath.replaceFirst(assetsCachePrefix, ''); + } + fileContent = await (assets ?? Flame.assets).readFile( - fullPath, - package: package, + finalPath, + package: currentPackage, ); } @@ -293,6 +315,30 @@ Future _parse( // Check if this line looks like a texture file (has file extension) if (_isTextureFile(line)) { + // Peek at the next line to see if it's a region or a new page. + // Regions are followed by properties like 'bounds:', 'rotate:', 'xy:', 'offsets:'. + // Pages are followed by 'size:', 'format:', 'filter:', 'repeat:'. + if (lineQueue.length > 1) { + final nextLine = lineQueue.elementAt(1).trim(); + final isRegionProperty = + nextLine.startsWith('bounds:') || + nextLine.startsWith('rotate:') || + nextLine.startsWith('xy:') || + nextLine.startsWith('offsets:') || + nextLine.startsWith('orig:') || + nextLine.startsWith('offset:') || + nextLine.startsWith('index:'); + + if (isRegionProperty) { + // This is a region name that happens to have a file extension. + final region = _parseRegion(lineQueue, page); + if (region.index != -1) { + hasIndexes = true; + } + regions.add(region); + continue; + } + } break; // This is a new page, break out of region parsing } @@ -388,7 +434,29 @@ Future _parsePage( } } - page.texture = await images.load(fullTexturePath, package: package); + var currentPackage = package; + var finalTexturePath = fullTexturePath; + + const packageKeyword = 'packages/'; + final packageIndex = finalTexturePath.indexOf(packageKeyword); + if (packageIndex != -1) { + final subPath = finalTexturePath.substring( + packageIndex + packageKeyword.length, + ); + final parts = subPath.split('/'); + if (parts.length > 1) { + currentPackage ??= parts[0]; + finalTexturePath = parts.sublist(1).join('/'); + } + } + + // Images cache also prepends its own prefix (usually 'assets/images/') + final imagesPrefix = images.prefix; + if (finalTexturePath.startsWith(imagesPrefix)) { + finalTexturePath = finalTexturePath.replaceFirst(imagesPrefix, ''); + } + + page.texture = await images.load(finalTexturePath, package: currentPackage); } _parsePageProperties(lineQueue, page); @@ -436,7 +504,29 @@ void _parsePageProperties(ListQueue lineQueue, Page page) { /// /// Returns the parsed [Region]. Region _parseRegion(ListQueue lineQueue, Page page) { - final name = lineQueue.removeFirst().trim(); + var name = lineQueue.removeFirst().trim(); + var extractedIndex = -1; + + // Attempt to extract index and clean name if it follows patterns like + // 'name_01.png' or 'name_01' + final extensionMatch = RegExp( + r'\.(png|jpg|jpeg|bmp|tga|webp)$', + caseSensitive: false, + ).firstMatch(name); + if (extensionMatch != null) { + name = name.substring(0, extensionMatch.start); + } + + final indexMatch = RegExp(r'_(\d+)$').firstMatch(name); + if (indexMatch != null) { + try { + extractedIndex = int.parse(indexMatch.group(1)!); + name = name.substring(0, indexMatch.start); + } catch (_) { + // Ignore parsing errors for very large numbers + } + } + final values = >{}; while (lineQueue.isNotEmpty) { @@ -504,7 +594,7 @@ Region _parseRegion(ListQueue lineQueue, Page page) { originalHeight: finalOriginalHeight, degrees: _parseDegrees(rotate?.first), rotate: _parseDegrees(rotate?.first) == 90, - index: index != null ? int.parse(index[0]) : -1, + index: index != null ? int.parse(index[0]) : extractedIndex, ); } diff --git a/packages/flame_texturepacker/pubspec.yaml b/packages/flame_texturepacker/pubspec.yaml index 5e05cecea88..dd711e696c8 100644 --- a/packages/flame_texturepacker/pubspec.yaml +++ b/packages/flame_texturepacker/pubspec.yaml @@ -18,7 +18,7 @@ environment: dependencies: collection: ^1.17.1 cross_file: ^0.3.4+2 - flame: ^1.36.0 + flame: ^1.35.0 flutter: sdk: flutter diff --git a/packages/flame_texturepacker/test/atlas_path_resolution_test.dart b/packages/flame_texturepacker/test/atlas_path_resolution_test.dart index 6ca85fce83c..8986a169bd6 100644 --- a/packages/flame_texturepacker/test/atlas_path_resolution_test.dart +++ b/packages/flame_texturepacker/test/atlas_path_resolution_test.dart @@ -44,6 +44,8 @@ sprite1 when( () => images.load(any(), package: any(named: 'package')), ).thenAnswer((_) async => FakeImage()); + + when(() => images.prefix).thenReturn('assets/images/'); }); test('should resolve paths correctly with leading slashes', () async { @@ -124,5 +126,64 @@ sprite1 () => images.load('images/test.png', package: 'my_package'), ).called(1); }); + + test( + 'should auto-detect package from path if package parameter is null', + () async { + final assets = AssetsCache(bundle: bundle); + + await TexturePackerAtlas.load( + 'packages/custom_package/assets/images/atlas_name.atlas', + assets: assets, + images: images, + ); + + // Verify bundle call extracted 'custom_package' and cleaned the path + verify( + () => bundle.loadString( + 'packages/custom_package/assets/images/atlas_name.atlas', + cache: any(named: 'cache'), + ), + ).called(1); + + // Verify images.load also uses the extracted package + verify( + () => images.load('test.png', package: 'custom_package'), + ).called(1); + }, + ); + + test( + 'should correctly parse region names with .png and extracted indexes', + () async { + final assets = AssetsCache(bundle: bundle); + final complexAtlasContent = ''' +knight.png +size: 64, 64 +filter: Nearest, Nearest +repeat: none +knight_walk_01.png + bounds: 0, 0, 32, 32 +knight_walk_02.png + bounds: 32, 0, 32, 32 +'''; + + when( + () => bundle.loadString(any(), cache: any(named: 'cache')), + ).thenAnswer((_) async => complexAtlasContent); + + final atlas = await TexturePackerAtlas.load( + 'knight.atlas', + assets: assets, + images: images, + ); + + expect(atlas.sprites.length, 2); + expect(atlas.sprites[0].region.name, 'knight_walk'); + expect(atlas.sprites[0].region.index, 1); + expect(atlas.sprites[1].region.name, 'knight_walk'); + expect(atlas.sprites[1].region.index, 2); + }, + ); }); } From 614999ec5bae34668ebdbaa23f05dce66b0fc946 Mon Sep 17 00:00:00 2001 From: Dmitry <76906744+s1r1m1r1@users.noreply.github.com> Date: Tue, 10 Mar 2026 14:04:00 +0100 Subject: [PATCH 4/4] feat: (#3851) add HueEffect and HueDecorator for color hue manipulation --- doc/flame/effects/color_effects.md | 41 ++++++++ doc/flame/effects/effects.md | 14 +++ doc/flame/examples/lib/decorator_hue.dart | 32 +++++++ doc/flame/examples/lib/hue_effect.dart | 26 +++++ doc/flame/examples/lib/main.dart | 6 +- doc/flame/rendering/decorators.md | 59 +++++++++++- examples/lib/main.dart | 2 + examples/lib/stories/effects/effects.dart | 7 ++ .../stories/effects/hue_effect_example.dart | 30 ++++++ .../rendering/decorator_hue_example.dart | 54 +++++++++++ .../decorator_vs_effect_example.dart | 94 +++++++++++++++++++ .../lib/stories/rendering/decorators.dart | 21 +++++ packages/flame/lib/effects.dart | 7 +- packages/flame/lib/rendering.dart | 1 + .../lib/src/components/mixins/has_paint.dart | 28 +++++- .../flame/lib/src/effects/hue_by_effect.dart | 23 +++++ .../flame/lib/src/effects/hue_effect.dart | 52 ++++++++++ .../flame/lib/src/effects/hue_to_effect.dart | 30 ++++++ .../lib/src/effects/provider_interfaces.dart | 6 ++ .../flame/lib/src/rendering/decorator.dart | 12 ++- .../lib/src/rendering/hue_decorator.dart | 80 ++++++++++++++++ .../flame/test/effects/hue_effect_test.dart | 53 +++++++++++ .../test/rendering/hue_decorator_test.dart | 56 +++++++++++ 23 files changed, 727 insertions(+), 7 deletions(-) create mode 100644 doc/flame/examples/lib/decorator_hue.dart create mode 100644 doc/flame/examples/lib/hue_effect.dart create mode 100644 examples/lib/stories/effects/hue_effect_example.dart create mode 100644 examples/lib/stories/rendering/decorator_hue_example.dart create mode 100644 examples/lib/stories/rendering/decorator_vs_effect_example.dart create mode 100644 examples/lib/stories/rendering/decorators.dart create mode 100644 packages/flame/lib/src/effects/hue_by_effect.dart create mode 100644 packages/flame/lib/src/effects/hue_effect.dart create mode 100644 packages/flame/lib/src/effects/hue_to_effect.dart create mode 100644 packages/flame/lib/src/rendering/hue_decorator.dart create mode 100644 packages/flame/test/effects/hue_effect_test.dart create mode 100644 packages/flame/test/rendering/hue_decorator_test.dart diff --git a/doc/flame/effects/color_effects.md b/doc/flame/effects/color_effects.md index efbd903bca2..a2cf1e5b369 100644 --- a/doc/flame/effects/color_effects.md +++ b/doc/flame/effects/color_effects.md @@ -136,3 +136,44 @@ final effect = GlowEffect( ``` Currently this effect can only be applied to components that have a `HasPaint` mixin. + + +## `HueToEffect` + +This effect will change the hue of the target over time to the specified angle in radians. +It can only be applied to components that implement the `HueProvider`. + +```dart +final effect = HueEffect.to( + pi / 2, + EffectController(duration: 3), +); +``` + +## `HueByEffect` + +This effect will rotate the hue of the target relative by the specified angle in radians. +It can only be applied to components that implement the `HueProvider`. + +```{flutter-app} +:sources: ../flame/examples +:page: hue_effect +:show: widget code infobox +:width: 180 +:height: 160 +``` + +```dart +final effect = HueEffect.by( + 2 * tau, + EffectController(duration: 3), +); +``` + +Both effects can target any component implementing `HueProvider`. The `HasPaint` mixin +implements `HueProvider` and handles the necessary `ColorFilter` updates automatically. + +> [!TIP] +> **Performance Note**: `HueEffect` is extremely efficient because it modifies the `Paint`'s +> `colorFilter` directly. If you have many components, prefer this effect over the `HueDecorator`, +> which uses `saveLayer()` and has much higher overhead. diff --git a/doc/flame/effects/effects.md b/doc/flame/effects/effects.md index 6ef5ba4632b..7a8b5f67896 100644 --- a/doc/flame/effects/effects.md +++ b/doc/flame/effects/effects.md @@ -105,6 +105,20 @@ that property to a fixed value. This way multiple effects would be able to act o without interfering with each other. +## Effects vs Decorators + +While effects and decorators can sometimes achieve similar visual results (like changing opacity +or color), they have different performance and visual characteristics: + +- **Effects** are fast and generally change a property on a single component. When applied to + a group, they affect each child individually. +- **Decorators** are more powerful but slower. They use `saveLayer` to flatten a whole + component subtree into a single layer before applying an effect. This is essential for + correctly rendering composite objects with transparency or complex filters. + +See the [Decorators documentation](../rendering/decorators.md) for a more detailed comparison. + + ## See also - [Examples of various effects](https://examples.flame-engine.org/). diff --git a/doc/flame/examples/lib/decorator_hue.dart b/doc/flame/examples/lib/decorator_hue.dart new file mode 100644 index 00000000000..94c8e4c7e78 --- /dev/null +++ b/doc/flame/examples/lib/decorator_hue.dart @@ -0,0 +1,32 @@ +import 'dart:math'; + +import 'package:doc_flame_examples/flower.dart'; +import 'package:flame/game.dart'; +import 'package:flame/rendering.dart'; + +class DecoratorHueGame extends FlameGame { + @override + Future onLoad() async { + var step = 0; + add( + Flower( + size: 100, + position: canvasSize / 2, + onTap: (flower) { + final decorator = flower.decorator; + step++; + if (step == 1) { + decorator.addLast(HueDecorator(hue: pi / 4)); + } else if (step == 2) { + decorator.replaceLast(HueDecorator(hue: pi / 2)); + } else if (step == 3) { + decorator.replaceLast(HueDecorator(hue: pi)); + } else { + decorator.replaceLast(null); + step = 0; + } + }, + )..onTapUp(), + ); + } +} diff --git a/doc/flame/examples/lib/hue_effect.dart b/doc/flame/examples/lib/hue_effect.dart new file mode 100644 index 00000000000..6b396f25ec4 --- /dev/null +++ b/doc/flame/examples/lib/hue_effect.dart @@ -0,0 +1,26 @@ +import 'dart:math'; + +import 'package:doc_flame_examples/ember.dart'; +import 'package:flame/components.dart'; +import 'package:flame/effects.dart'; +import 'package:flame/game.dart'; + +class HueEffectExample extends FlameGame { + @override + Future onLoad() async { + final ember = EmberPlayer( + position: size / 2, + size: size / 4, + onTap: (ember) { + ember.add( + HueEffect.by( + 2 * pi, + EffectController(duration: 3), + ), + ); + }, + )..anchor = Anchor.center; + + add(ember); + } +} diff --git a/doc/flame/examples/lib/main.dart b/doc/flame/examples/lib/main.dart index 5bf3fef6b0f..6e8fa5f8584 100644 --- a/doc/flame/examples/lib/main.dart +++ b/doc/flame/examples/lib/main.dart @@ -5,11 +5,13 @@ import 'package:doc_flame_examples/collision_detection.dart'; import 'package:doc_flame_examples/color_effect.dart'; import 'package:doc_flame_examples/decorator_blur.dart'; import 'package:doc_flame_examples/decorator_grayscale.dart'; +import 'package:doc_flame_examples/decorator_hue.dart'; import 'package:doc_flame_examples/decorator_rotate3d.dart'; import 'package:doc_flame_examples/decorator_shadow3d.dart'; import 'package:doc_flame_examples/decorator_tint.dart'; import 'package:doc_flame_examples/drag_events.dart'; import 'package:doc_flame_examples/glow_effect.dart'; +import 'package:doc_flame_examples/hue_effect.dart'; import 'package:doc_flame_examples/move_along_path_effect.dart'; import 'package:doc_flame_examples/move_by_effect.dart'; import 'package:doc_flame_examples/move_to_effect.dart'; @@ -39,18 +41,20 @@ import 'package:flutter/widgets.dart'; import 'package:web/web.dart' as web; final routes = { + 'anchor': AnchorGame.new, 'anchor_by_effect': AnchorByEffectGame.new, 'anchor_to_effect': AnchorToEffectGame.new, - 'anchor': AnchorGame.new, 'collision_detection': CollisionDetectionGame.new, 'color_effect': ColorEffectExample.new, 'decorator_blur': DecoratorBlurGame.new, 'decorator_grayscale': DecoratorGrayscaleGame.new, + 'decorator_hue': DecoratorHueGame.new, 'decorator_rotate3d': DecoratorRotate3DGame.new, 'decorator_shadow3d': DecoratorShadowGame.new, 'decorator_tint': DecoratorTintGame.new, 'drag_events': DragEventsGame.new, 'glow_effect': GlowEffectExample.new, + 'hue_effect': HueEffectExample.new, 'move_along_path_effect': MoveAlongPathEffectGame.new, 'move_by_effect': MoveByEffectGame.new, 'move_to_effect': MoveToEffectGame.new, diff --git a/doc/flame/rendering/decorators.md b/doc/flame/rendering/decorators.md index fb15f8d557d..e53e624bba0 100644 --- a/doc/flame/rendering/decorators.md +++ b/doc/flame/rendering/decorators.md @@ -10,6 +10,38 @@ necessary. We are planning to add shader-based decorators once Flutter fully sup web. +## Performance considerations + +Applying a Decorator to a component can have a significant performance overhead, especially when +it involves `canvas.saveLayer()`. + +- **Decorators**: Use `canvas.saveLayer()` by default to isolate rendering and apply + filters. This requires off-screen buffer allocation and GPU context switches. This is + computationally expensive but essential for correct visual composition of complex + objects (see below). +- **Effects** (e.g., `OpacityEffect`, `ColorEffect`): Modify the component's properties or `Paint` directly. These are extremely fast and hardware-accelerated, but they apply to each child individually. + +### Decorators vs Effects: Visual Composition + +The key difference lies in how they handle composite objects (components with multiple +overlapping children): + +1. **Effects (Individual Blend)**: If you apply an `OpacityEffect` to a parent component, + Flame will render each child with that opacity. If children overlap, you will see + through them to the background and to other children, creating a "double-exposure" + look. +2. **Decorators (Group Blend)**: Because decorators use `saveLayer`, they render the + entire subtree into a flat buffer first, and then apply the effect to that + buffer. This results in a uniform appearance where overlaps are not visible, + making the group look like a single solid object. + +**Recommendation**: +- Use **Effects** for simple property animations and high-performance color shifts on + large numbers of units. +- Use **Decorators** for advanced post-processing (blurs, tints) and when you need + to treat a group of components as a single visual unit. + + ## Flame built-in decorators @@ -157,6 +189,29 @@ limitation is that the shadows are flat and cannot interact with the environment decorator cannot handle shadows that fall onto walls or other vertical structures. +### HueDecorator + +```{flutter-app} +:sources: ../flame/examples +:page: decorator_hue +:show: widget code infobox +:width: 180 +:height: 160 +``` + +This decorator shifts the hue of the underlying component by the specified angle in radians. + +```dart +final decorator = HueDecorator(hue: tau / 4); +``` + +Possible uses: + +- alternative color schemes for enemies ("palette swapping"); +- environmental changes (e.g., world turning purple/surreal); +- power-up indicators. + + ## Using decorators @@ -175,7 +230,7 @@ components the `HasDecorator` mixin is not needed. In fact, the `PositionComponent` uses its decorator in order to properly position the component on the screen. Thus, any new decorators that you'd want to apply to the `PositionComponent` will need -to be chained (see the [](#multiple-decorators) section below). +to be chained (see the [Multiple decorators](#multiple-decorators) section below). It is also possible to replace the root decorator of the `PositionComponent`, if you want to create an alternative logic for how the component shall be positioned on the screen. @@ -196,5 +251,5 @@ from its root, which usually is `component.decorator`. [Component]: ../components/components.md#component -[Effect]: ../../flame/effects.md +[Effect]: ../effects/effects.md [HasDecorator]: #hasdecorator-mixin diff --git a/examples/lib/main.dart b/examples/lib/main.dart index f8037ef8d4d..c614f0c75d4 100644 --- a/examples/lib/main.dart +++ b/examples/lib/main.dart @@ -29,6 +29,7 @@ import 'package:examples/stories/image/image.dart'; import 'package:examples/stories/input/input.dart'; import 'package:examples/stories/layout/layout.dart'; import 'package:examples/stories/parallax/parallax.dart'; +import 'package:examples/stories/rendering/decorators.dart'; import 'package:examples/stories/rendering/rendering.dart'; import 'package:examples/stories/router/router.dart'; import 'package:examples/stories/sprites/sprites.dart'; @@ -83,6 +84,7 @@ void runAsDashbook() { addCameraAndViewportStories(dashbook); addCollisionDetectionStories(dashbook); addComponentsStories(dashbook); + addDecoratorStories(dashbook); addEffectsStories(dashbook); addExperimentalStories(dashbook); addInputStories(dashbook); diff --git a/examples/lib/stories/effects/effects.dart b/examples/lib/stories/effects/effects.dart index 97f1fdf6611..4d6dd242f2f 100644 --- a/examples/lib/stories/effects/effects.dart +++ b/examples/lib/stories/effects/effects.dart @@ -5,6 +5,7 @@ import 'package:examples/stories/effects/combined_effect_example.dart'; import 'package:examples/stories/effects/dual_effect_removal_example.dart'; import 'package:examples/stories/effects/effect_controllers_example.dart'; import 'package:examples/stories/effects/function_effect_example.dart'; +import 'package:examples/stories/effects/hue_effect_example.dart'; import 'package:examples/stories/effects/move_effect_example.dart'; import 'package:examples/stories/effects/opacity_effect_example.dart'; import 'package:examples/stories/effects/remove_effect_example.dart'; @@ -59,6 +60,12 @@ void addEffectsStories(Dashbook dashbook) { codeLink: baseLink('effects/opacity_effect_example.dart'), info: OpacityEffectExample.description, ) + ..add( + 'Hue Effect', + (_) => GameWidget(game: HueEffectExample()), + codeLink: baseLink('effects/hue_effect_example.dart'), + info: HueEffectExample.description, + ) ..add( 'Color Effect', (_) => GameWidget(game: ColorEffectExample()), diff --git a/examples/lib/stories/effects/hue_effect_example.dart b/examples/lib/stories/effects/hue_effect_example.dart new file mode 100644 index 00000000000..04752c70391 --- /dev/null +++ b/examples/lib/stories/effects/hue_effect_example.dart @@ -0,0 +1,30 @@ +import 'dart:math'; + +import 'package:examples/commons/ember.dart'; +import 'package:flame/effects.dart'; +import 'package:flame/game.dart'; + +class HueEffectExample extends FlameGame { + static const String description = ''' +In this example we show how the `HueEffect` can be used. +Ember will shift its hue over time. + '''; + + @override + Future onLoad() async { + add( + Ember( + position: size / 2, + size: Vector2.all(100), + )..add( + HueEffect.by( + 2 * pi, + EffectController( + duration: 3, + infinite: true, + ), + ), + ), + ); + } +} diff --git a/examples/lib/stories/rendering/decorator_hue_example.dart b/examples/lib/stories/rendering/decorator_hue_example.dart new file mode 100644 index 00000000000..ba0ba40f749 --- /dev/null +++ b/examples/lib/stories/rendering/decorator_hue_example.dart @@ -0,0 +1,54 @@ +import 'dart:math'; + +import 'package:examples/commons/ember.dart'; +import 'package:flame/components.dart'; +import 'package:flame/events.dart'; +import 'package:flame/game.dart'; +import 'package:flame/rendering.dart'; + +class DecoratorHueExample extends FlameGame with TapCallbacks { + static const String description = ''' + This example demonstrates the usage of `HueDecorator` to shift the + colors of a component. + + Basic `HueDecorator` shifting the hue of an Ember component. + + Click to cycle through hue shifts. + '''; + + late final HueDecorator decorator; + int step = 0; + + @override + Future onLoad() async { + decorator = HueDecorator(); + world.add( + _buildItem('HueDecorator', decorator), + ); + } + + PositionComponent _buildItem(String title, HueDecorator decorator) { + return PositionComponent( + size: Vector2(150, 120), + children: [ + Ember( + size: Vector2.all(80), + position: Vector2(75, 40), + ), + TextComponent( + text: title, + position: Vector2(75, 100), + anchor: Anchor.center, + ), + ], + )..decorator.addLast(decorator); + } + + @override + void onTapDown(TapDownEvent event) { + step++; + final hues = [0.0, pi / 4, pi / 2, pi, 0.0]; + final hue = hues[step % hues.length]; + decorator.hue = hue; + } +} diff --git a/examples/lib/stories/rendering/decorator_vs_effect_example.dart b/examples/lib/stories/rendering/decorator_vs_effect_example.dart new file mode 100644 index 00000000000..918fe5ffb5c --- /dev/null +++ b/examples/lib/stories/rendering/decorator_vs_effect_example.dart @@ -0,0 +1,94 @@ +import 'package:examples/commons/ember.dart'; +import 'package:flame/components.dart'; +import 'package:flame/effects.dart'; +import 'package:flame/experimental.dart'; +import 'package:flame/game.dart'; +import 'package:flame/rendering.dart'; +import 'package:flutter/widgets.dart'; + +class DecoratorVsEffectExample extends FlameGame { + static const String description = ''' + This example demonstrates the difference between using an `Effect` and a + `Decorator` for group transparency. + + 1. Top (OpacityEffect): + Opacity is applied to EACH child individually. + Note the "double-exposure" where the sprites overlap. + + 2. Bottom (Decorator): + The entire group is flattened into a layer first using `saveLayer`, + and then transparency is applied to the whole layer. + Note how the overlapping area is uniform. + '''; + + @override + Future onLoad() async { + final groupA = _buildItem( + 'OpacityEffect (Individual Blend)', + _buildCompositeObject() + ..children.forEach((child) { + if (child is OpacityProvider) { + child.add(OpacityEffect.to(0.5, EffectController(duration: 0))); + } + }), + ); + + final groupB = _buildItem( + 'Decorator (Group Blend)', + _buildCompositeObject(), + )..decorator.addLast(_GroupOpacityDecorator(0.5)); + + world.add( + ColumnComponent( + gap: 150, + anchor: Anchor.center, + children: [groupA, groupB], + ), + ); + } + + PositionComponent _buildItem(String title, Component object) { + return PositionComponent( + size: Vector2(150, 120), + children: [ + object, + TextComponent( + text: title, + position: Vector2(0, 80), + anchor: Anchor.center, + ), + ], + ); + } + + /// Builds an object consisting of two overlapping Embers. + Component _buildCompositeObject() { + return PositionComponent( + children: [ + Ember( + size: Vector2.all(100), + position: Vector2(-25, 0), + ), + Ember( + size: Vector2.all(100), + position: Vector2(25, 0), + ), + ], + ); + } +} + +/// A simple decorator that applies opacity to the entire decorated subtree. +class _GroupOpacityDecorator extends Decorator { + _GroupOpacityDecorator(double opacity) + : _paint = Paint()..color = Color.fromRGBO(255, 255, 255, opacity); + + final Paint _paint; + + @override + void apply(void Function(Canvas) draw, Canvas canvas) { + canvas.saveLayer(null, _paint); + draw(canvas); + canvas.restore(); + } +} diff --git a/examples/lib/stories/rendering/decorators.dart b/examples/lib/stories/rendering/decorators.dart new file mode 100644 index 00000000000..8bb76b30927 --- /dev/null +++ b/examples/lib/stories/rendering/decorators.dart @@ -0,0 +1,21 @@ +import 'package:dashbook/dashbook.dart'; +import 'package:examples/commons/commons.dart'; +import 'package:examples/stories/rendering/decorator_hue_example.dart'; +import 'package:examples/stories/rendering/decorator_vs_effect_example.dart'; +import 'package:flame/game.dart'; + +void addDecoratorStories(Dashbook dashbook) { + dashbook.storiesOf('Decorators') + ..add( + 'Decorator Hue', + (_) => GameWidget(game: DecoratorHueExample()), + codeLink: baseLink('rendering/hue_decorator_example.dart'), + info: DecoratorHueExample.description, + ) + ..add( + 'Decorators vs Effects', + (_) => GameWidget(game: DecoratorVsEffectExample()), + codeLink: baseLink('rendering/decorator_vs_effect_example.dart'), + info: DecoratorVsEffectExample.description, + ); +} diff --git a/packages/flame/lib/effects.dart b/packages/flame/lib/effects.dart index 2f0ed154e1a..a7c46559a83 100644 --- a/packages/flame/lib/effects.dart +++ b/packages/flame/lib/effects.dart @@ -25,6 +25,9 @@ export 'src/effects/effect.dart'; export 'src/effects/effect_target.dart'; export 'src/effects/function_effect.dart'; export 'src/effects/glow_effect.dart'; +export 'src/effects/hue_by_effect.dart'; +export 'src/effects/hue_effect.dart'; +export 'src/effects/hue_to_effect.dart'; export 'src/effects/move_along_path_effect.dart'; export 'src/effects/move_by_effect.dart'; export 'src/effects/move_effect.dart'; @@ -41,7 +44,9 @@ export 'src/effects/provider_interfaces.dart' ReadOnlyPositionProvider, ReadOnlyScaleProvider, ReadOnlySizeProvider, - OpacityProvider; + OpacityProvider, + PaintProvider, + HueProvider; export 'src/effects/remove_effect.dart'; export 'src/effects/rotate_around_effect.dart'; export 'src/effects/rotate_effect.dart'; diff --git a/packages/flame/lib/rendering.dart b/packages/flame/lib/rendering.dart index 481d430d4c4..8df69a15290 100644 --- a/packages/flame/lib/rendering.dart +++ b/packages/flame/lib/rendering.dart @@ -1,4 +1,5 @@ export 'src/rendering/decorator.dart' show Decorator; +export 'src/rendering/hue_decorator.dart' show HueDecorator; export 'src/rendering/mutable_transform.dart' show MutableRSTransform; export 'src/rendering/paint_decorator.dart' show PaintDecorator; export 'src/rendering/rotate3d_decorator.dart' show Rotate3DDecorator; diff --git a/packages/flame/lib/src/components/mixins/has_paint.dart b/packages/flame/lib/src/components/mixins/has_paint.dart index 6b45e9d3bae..437288bb090 100644 --- a/packages/flame/lib/src/components/mixins/has_paint.dart +++ b/packages/flame/lib/src/components/mixins/has_paint.dart @@ -3,8 +3,8 @@ import 'dart:ui'; import 'package:flame/components.dart'; import 'package:flame/effects.dart'; -import 'package:flame/src/effects/provider_interfaces.dart'; import 'package:flame/src/palette.dart'; +import 'package:flame/src/rendering/hue_decorator.dart'; import 'package:meta/meta.dart'; /// Adds a collection of paints and paint layers to a component @@ -16,12 +16,14 @@ import 'package:meta/meta.dart'; /// [paintLayers] paints should be drawn in list order during the render. The /// main Paint is the first element. mixin HasPaint on Component - implements OpacityProvider, PaintProvider { + implements OpacityProvider, PaintProvider, HueProvider { late final Map _paints = {}; @override Paint paint = BasicPalette.white.paint(); + double _hue = 0.0; + @internal List? paintLayersInternal; @@ -131,6 +133,28 @@ mixin HasPaint on Component } } + @override + double get hue => _hue; + + @override + set hue(double value) { + if (_hue == value) { + return; + } + _hue = value; + _updateColorFilter(); + } + + void _updateColorFilter() { + final filter = _hue == 0 + ? null + : ColorFilter.matrix(HueDecorator.hueMatrix(_hue)); + paint.colorFilter = filter; + for (final paint in _paints.values) { + paint.colorFilter = filter; + } + } + /// Creates an [OpacityProvider] for given [paintId] and can be used as /// `target` for [OpacityEffect]. OpacityProvider opacityProviderOf(T paintId) { diff --git a/packages/flame/lib/src/effects/hue_by_effect.dart b/packages/flame/lib/src/effects/hue_by_effect.dart new file mode 100644 index 00000000000..77c02e8aa02 --- /dev/null +++ b/packages/flame/lib/src/effects/hue_by_effect.dart @@ -0,0 +1,23 @@ +import 'package:flame/src/effects/hue_effect.dart'; +import 'package:flame/src/effects/provider_interfaces.dart'; + +/// An effect that changes the hue of a component by a specified angle. +class HueByEffect extends HueEffect { + HueByEffect( + double angle, + super.controller, { + HueProvider? target, + super.onComplete, + super.key, + }) : _angle = angle { + this.target = target; + } + + final double _angle; + + @override + void apply(double progress) { + final dProgress = progress - previousProgress; + target.hue += _angle * dProgress; + } +} diff --git a/packages/flame/lib/src/effects/hue_effect.dart b/packages/flame/lib/src/effects/hue_effect.dart new file mode 100644 index 00000000000..774ab40b48e --- /dev/null +++ b/packages/flame/lib/src/effects/hue_effect.dart @@ -0,0 +1,52 @@ +import 'package:flame/components.dart'; +import 'package:flame/src/effects/controllers/effect_controller.dart'; +import 'package:flame/src/effects/effect.dart'; +import 'package:flame/src/effects/effect_target.dart'; +import 'package:flame/src/effects/hue_by_effect.dart'; +import 'package:flame/src/effects/hue_to_effect.dart'; +import 'package:flame/src/effects/provider_interfaces.dart'; + +/// An effect that changes the hue of a component over time. +/// +/// This effect applies incremental changes to the hue property of the target, +/// and requires that any other effect or update logic applied to the same +/// target also used incremental updates. +abstract class HueEffect extends Effect with EffectTarget { + HueEffect( + super.controller, { + super.onComplete, + super.key, + }); + + factory HueEffect.by( + double angle, + EffectController controller, { + HueProvider? target, + void Function()? onComplete, + ComponentKey? key, + }) { + return HueByEffect( + angle, + controller, + target: target, + onComplete: onComplete, + key: key, + ); + } + + factory HueEffect.to( + double angle, + EffectController controller, { + HueProvider? target, + void Function()? onComplete, + ComponentKey? key, + }) { + return HueToEffect( + angle, + controller, + target: target, + onComplete: onComplete, + key: key, + ); + } +} diff --git a/packages/flame/lib/src/effects/hue_to_effect.dart b/packages/flame/lib/src/effects/hue_to_effect.dart new file mode 100644 index 00000000000..62f47d6ad9e --- /dev/null +++ b/packages/flame/lib/src/effects/hue_to_effect.dart @@ -0,0 +1,30 @@ +import 'package:flame/src/effects/hue_effect.dart'; +import 'package:flame/src/effects/provider_interfaces.dart'; + +/// An effect that changes the hue of a component to a specified angle. +class HueToEffect extends HueEffect { + HueToEffect( + double angle, + super.controller, { + HueProvider? target, + super.onComplete, + super.key, + }) : _destinationAngle = angle, + _angle = 0 { + this.target = target; + } + + final double _destinationAngle; + double _angle; + + @override + void onStart() { + _angle = _destinationAngle - target.hue; + } + + @override + void apply(double progress) { + final dProgress = progress - previousProgress; + target.hue += _angle * dProgress; + } +} diff --git a/packages/flame/lib/src/effects/provider_interfaces.dart b/packages/flame/lib/src/effects/provider_interfaces.dart index f7a4e20aa88..0bc08988992 100644 --- a/packages/flame/lib/src/effects/provider_interfaces.dart +++ b/packages/flame/lib/src/effects/provider_interfaces.dart @@ -94,3 +94,9 @@ abstract class PaintProvider { Paint get paint; set paint(Paint value); } + +/// Interface for a component that can be affected by hue effects. +abstract class HueProvider { + double get hue; + set hue(double value); +} diff --git a/packages/flame/lib/src/rendering/decorator.dart b/packages/flame/lib/src/rendering/decorator.dart index b9457223ef1..c8ba2e08def 100644 --- a/packages/flame/lib/src/rendering/decorator.dart +++ b/packages/flame/lib/src/rendering/decorator.dart @@ -27,6 +27,12 @@ import 'package:meta/meta.dart'; /// - [Rotate3DDecorator] /// - [Shadow3DDecorator] /// - [Transform2DDecorator] +/// +/// **Performance Note**: Decorators +/// that use `canvas.saveLayer()` (like `HueDecorator`) have +/// significant overhead compared to direct [Paint] +/// manipulation (like `HueEffect`). +/// Prefer shader-driven Effects for high-density rendering. class Decorator { /// The next decorator in the chain, or null if there is none. Decorator? _next; @@ -43,8 +49,12 @@ class Decorator { ); } + /// Updates the decorator and all subsequent decorators in the chain. + void update(double dt) { + _next?.update(dt); + } + /// Applies visual effect while [draw]ing on the [canvas]. - /// /// The default implementation is a no-op; all other non-trivial decorators /// transform the canvas before drawing, or perform some other adjustments. /// diff --git a/packages/flame/lib/src/rendering/hue_decorator.dart b/packages/flame/lib/src/rendering/hue_decorator.dart new file mode 100644 index 00000000000..c0777b02cab --- /dev/null +++ b/packages/flame/lib/src/rendering/hue_decorator.dart @@ -0,0 +1,80 @@ +import 'dart:math' as math; +import 'dart:ui'; + +import 'package:flame/src/rendering/decorator.dart'; + +/// [HueDecorator] is a [Decorator] that shifts the hue of the component. +/// +/// The [hue] value is in radians. +/// Standard range is from -pi to pi, or 0 to 2*pi. +class HueDecorator extends Decorator { + HueDecorator({double hue = 0.0}) : _hue = hue; + + final _paint = Paint(); + double _hue; + bool _isDirty = true; + + /// The hue shift in radians. + double get hue => _hue; + set hue(double value) { + if (_hue != value) { + _hue = value; + _isDirty = true; + } + } + + @override + void apply( + void Function(Canvas) draw, + Canvas canvas, + ) { + if (_hue == 0.0) { + draw(canvas); + return; + } + + if (_isDirty) { + _updatePaint(); + _isDirty = false; + } + + canvas.saveLayer(null, _paint); + draw(canvas); + canvas.restore(); + } + + void _updatePaint() { + _paint.colorFilter = ColorFilter.matrix(hueMatrix(_hue)); + } + + /// Calculates the hue rotation matrix for a given angle in radians. + static List hueMatrix(double angle) { + final cosT = math.cos(angle); + final sinT = math.sin(angle); + + // Standard hue rotation matrix using NTSC luminance weights: + // R: 0.213, G: 0.715, B: 0.072 + return [ + 0.213 + 0.787 * cosT - 0.213 * sinT, + 0.715 - 0.715 * cosT - 0.715 * sinT, + 0.072 - 0.072 * cosT + 0.928 * sinT, + 0, + 0, + 0.213 - 0.213 * cosT + 0.143 * sinT, + 0.715 + 0.285 * cosT + 0.140 * sinT, + 0.072 - 0.072 * cosT - 0.283 * sinT, + 0, + 0, + 0.213 - 0.213 * cosT - 0.787 * sinT, + 0.715 - 0.715 * cosT + 0.715 * sinT, + 0.072 + 0.928 * cosT + 0.072 * sinT, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + ]; + } +} diff --git a/packages/flame/test/effects/hue_effect_test.dart b/packages/flame/test/effects/hue_effect_test.dart new file mode 100644 index 00000000000..7b1d2d15104 --- /dev/null +++ b/packages/flame/test/effects/hue_effect_test.dart @@ -0,0 +1,53 @@ +import 'dart:math'; + +import 'package:flame/components.dart'; +import 'package:flame/effects.dart'; +import 'package:flame_test/flame_test.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('HueEffect', () { + testWithFlameGame('can apply to component having HasPaint', (game) async { + final component = _PaintComponent(); + await game.ensureAdd(component); + await component.add( + HueEffect.by(pi, EffectController(duration: 1)), + ); + + game.update(0); + + expect(component.children.length, 1); + // At progress 0, hue is 0, so colorFilter should be null + // due to optimization. + expect(component.paint.colorFilter, isNull); + + game.update(0.5); + final filter05 = component.paint.colorFilter; + expect(filter05, isNotNull); + + game.update(0.5); + final filter1 = component.paint.colorFilter; + expect(filter1, isNotNull); + expect(filter1, isNot(equals(filter05))); + }); + + testWithFlameGame('reset works correctly', (game) async { + final component = _PaintComponent(); + await game.ensureAdd(component); + final effect = HueEffect.by(pi, EffectController(duration: 1)); + await component.add(effect); + + game.update(0.5); + expect(component.paint.colorFilter, isNotNull); + + effect.reset(); + // Incremental effects don't usually clear the target property on reset. + // If we want to maintain the old behavior, + // we'd need to manually set hue to 0. + component.hue = 0; + expect(component.paint.colorFilter, isNull); + }); + }); +} + +class _PaintComponent extends Component with HasPaint {} diff --git a/packages/flame/test/rendering/hue_decorator_test.dart b/packages/flame/test/rendering/hue_decorator_test.dart new file mode 100644 index 00000000000..ff9cd9d668b --- /dev/null +++ b/packages/flame/test/rendering/hue_decorator_test.dart @@ -0,0 +1,56 @@ +import 'dart:math' as math; +import 'dart:ui'; +import 'package:flame/rendering.dart'; +import 'package:flutter_test/flutter_test.dart'; + +void main() { + group('HueDecorator', () { + test('can be instantiated', () { + final decorator = HueDecorator(); + expect(decorator.hue, 0.0); + }); + + test('hue property updates correctly', () { + final decorator = HueDecorator(); + decorator.hue = math.pi; + expect(decorator.hue, math.pi); + }); + + test('apply with hue 0 does not use saveLayer', () { + final decorator = HueDecorator(); + var drawCalled = false; + final canvas = _MockCanvas(); + + decorator.apply((c) => drawCalled = true, canvas); + + expect(drawCalled, isTrue); + expect(canvas.saveLayerCalled, isFalse); + }); + + test('apply with non-zero hue uses saveLayer', () { + final decorator = HueDecorator(hue: math.pi / 2); + var drawCalled = false; + final canvas = _MockCanvas(); + + decorator.apply((c) => drawCalled = true, canvas); + + expect(drawCalled, isTrue); + expect(canvas.saveLayerCalled, isTrue); + }); + }); +} + +class _MockCanvas extends Fake implements Canvas { + bool saveLayerCalled = false; + bool restoreCalled = false; + + @override + void saveLayer(Rect? bounds, Paint paint) { + saveLayerCalled = true; + } + + @override + void restore() { + restoreCalled = true; + } +}