Skip to content

Commit

Permalink
Merge branch 'main' into feat/adding-flame-console
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzanardo authored Oct 22, 2024
2 parents 1ecbb67 + 291af57 commit 2e20936
Show file tree
Hide file tree
Showing 101 changed files with 1,316 additions and 194 deletions.
83 changes: 83 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,89 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2024-10-16

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`flame` - `v1.21.0`](#flame---v1210)
- [`flame_fire_atlas` - `v1.6.0`](#flame_fire_atlas---v160)
- [`flame_test` - `v1.17.2`](#flame_test---v1172)
- [`flame_tiled` - `v1.21.0`](#flame_tiled---v1210)
- [`flame_audio` - `v2.10.5`](#flame_audio---v2105)
- [`flame_forge2d` - `v0.18.2+2`](#flame_forge2d---v01822)
- [`flame_oxygen` - `v0.2.3+2`](#flame_oxygen---v0232)
- [`flame_rive` - `v1.10.5`](#flame_rive---v1105)
- [`flame_texturepacker` - `v4.1.2`](#flame_texturepacker---v412)
- [`flame_behavior_tree` - `v0.1.3+2`](#flame_behavior_tree---v0132)
- [`flame_spine` - `v0.2.2+2`](#flame_spine---v0222)
- [`flame_riverpod` - `v5.4.5`](#flame_riverpod---v545)
- [`flame_kenney_xml` - `v0.1.1+2`](#flame_kenney_xml---v0112)
- [`flame_bloc` - `v1.12.3`](#flame_bloc---v1123)
- [`flame_noise` - `v0.3.2+2`](#flame_noise---v0322)
- [`flame_lottie` - `v0.4.2+2`](#flame_lottie---v0422)
- [`flame_network_assets` - `v0.3.3+2`](#flame_network_assets---v0332)
- [`flame_svg` - `v1.11.2`](#flame_svg---v1112)
- [`flame_sprite_fusion` - `v0.1.3+2`](#flame_sprite_fusion---v0132)
- [`flame_markdown` - `v0.2.2+2`](#flame_markdown---v0222)
- [`flame_isolate` - `v0.6.2+2`](#flame_isolate---v0622)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `flame_audio` - `v2.10.5`
- `flame_forge2d` - `v0.18.2+2`
- `flame_oxygen` - `v0.2.3+2`
- `flame_rive` - `v1.10.5`
- `flame_texturepacker` - `v4.1.2`
- `flame_behavior_tree` - `v0.1.3+2`
- `flame_spine` - `v0.2.2+2`
- `flame_riverpod` - `v5.4.5`
- `flame_kenney_xml` - `v0.1.1+2`
- `flame_bloc` - `v1.12.3`
- `flame_noise` - `v0.3.2+2`
- `flame_lottie` - `v0.4.2+2`
- `flame_network_assets` - `v0.3.3+2`
- `flame_svg` - `v1.11.2`
- `flame_sprite_fusion` - `v0.1.3+2`
- `flame_markdown` - `v0.2.2+2`
- `flame_isolate` - `v0.6.2+2`

---

#### `flame` - `v1.21.0`

- **FIX**: Widgets flickering ([#3343](https://github.com/flame-engine/flame/issues/3343)). ([ff170dc5](https://github.com/flame-engine/flame/commit/ff170dc5c2acc41190249b48e61767ea459fabb4))
- **FIX**: Ray should not be able to escape `CircleHitbox` ([#3341](https://github.com/flame-engine/flame/issues/3341)). ([7311d034](https://github.com/flame-engine/flame/commit/7311d034d4c3b43592b49472384fe8576809e6a5))
- **FIX**: Fix SpriteBatch to comply with new drawAtlas requirement ([#3338](https://github.com/flame-engine/flame/issues/3338)). ([a17fe4cd](https://github.com/flame-engine/flame/commit/a17fe4cdfaafa071cfd2ab8ef8279b26b79f00a7))
- **FIX**: Set SpriteButtonComponent sprites in `onMount` ([#3327](https://github.com/flame-engine/flame/issues/3327)). ([f36533e7](https://github.com/flame-engine/flame/commit/f36533e78c7634866680ab5fb202a3e230529943))
- **FIX**: Export TapConfig to make visible ([#3323](https://github.com/flame-engine/flame/issues/3323)). ([8e00115c](https://github.com/flame-engine/flame/commit/8e00115cd299423564dfce4b9d1674c9257a3c42))
- **FIX**: Clarify `SpriteGroupComponent.updateSprite` assertion ([#3317](https://github.com/flame-engine/flame/issues/3317)). ([d976ee8c](https://github.com/flame-engine/flame/commit/d976ee8c7e4fbbca08e549412ca8b5af6928d4f4))
- **FEAT**: Adding spawnWhenLoaded flag on SpawnComponent ([#3334](https://github.com/flame-engine/flame/issues/3334)). ([51a7e26b](https://github.com/flame-engine/flame/commit/51a7e26b1ab0ef2a2d040548c74aef84b164272d))
- **FEAT**: Add a getter for images cache keys ([#3324](https://github.com/flame-engine/flame/issues/3324)). ([7746f2f8](https://github.com/flame-engine/flame/commit/7746f2f867092c19222a40aec2b66dc80558dccb))

#### `flame_fire_atlas` - `v1.6.0`

- **FEAT**: Adding getter for the atlas image on flame fire atlas ([#3326](https://github.com/flame-engine/flame/issues/3326)). ([ae230ffa](https://github.com/flame-engine/flame/commit/ae230ffaaa588df7a99a3e2e8fa8980dc32104c0))

#### `flame_test` - `v1.17.2`

- **FIX**: Widgets flickering ([#3343](https://github.com/flame-engine/flame/issues/3343)). ([ff170dc5](https://github.com/flame-engine/flame/commit/ff170dc5c2acc41190249b48e61767ea459fabb4))
- **FIX**: Fix SpriteBatch to comply with new drawAtlas requirement ([#3338](https://github.com/flame-engine/flame/issues/3338)). ([a17fe4cd](https://github.com/flame-engine/flame/commit/a17fe4cdfaafa071cfd2ab8ef8279b26b79f00a7))

#### `flame_tiled` - `v1.21.0`

- **FEAT**: Add a getter for images cache keys ([#3324](https://github.com/flame-engine/flame/issues/3324)). ([7746f2f8](https://github.com/flame-engine/flame/commit/7746f2f867092c19222a40aec2b66dc80558dccb))


## 2024-09-20

### Changes
Expand Down
4 changes: 2 additions & 2 deletions doc/flame/examples/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ environment:
flutter: ">=3.22.0"

dependencies:
flame: ^1.20.0
flame_rive: ^1.10.4
flame: ^1.21.0
flame_rive: ^1.10.5
flutter:
sdk: flutter

Expand Down
11 changes: 9 additions & 2 deletions doc/flame/overlays.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ by providing an `overlayBuilderMap`.
```dart
// Inside your game:
final pauseOverlayIdentifier = 'PauseMenu';
final secondaryOverlayIdentifier = 'SecondaryMenu';
// Marks 'PauseMenu' to be rendered.
// Marks 'SecondaryMenu' to be rendered.
overlays.add(secondaryOverlayIdentifier, priority: 1);
// Marks 'PauseMenu' to be rendered. Priority = 0 by default
// which means the 'PauseMenu' will be displayed under the 'SecondaryMenu'
overlays.add(pauseOverlayIdentifier);
// Marks 'PauseMenu' to not be rendered.
// Marks 'PauseMenu' to not be rendered.
overlays.remove(pauseOverlayIdentifier);
```

Expand All @@ -34,6 +38,9 @@ Widget build(BuildContext context) {
'PauseMenu': (BuildContext context, MyGame game) {
return Text('A pause menu');
},
'SecondaryMenu': (BuildContext context, MyGame game) {
return Text('A secondary menu');
},
},
);
}
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/klondike/app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ environment:
sdk: ">=3.4.0 <4.0.0"

dependencies:
flame: ^1.20.0
flame: ^1.21.0
flutter:
sdk: flutter

Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/platformer/app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
flutter: ">=3.22.0"

dependencies:
flame: ^1.20.0
flame: ^1.21.0
flutter:
sdk: flutter

Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials/space_shooter/app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
sdk: ">=3.4.0 <4.0.0"

dependencies:
flame: ^1.20.0
flame: ^1.21.0
flutter:
sdk: flutter

Expand Down
4 changes: 2 additions & 2 deletions examples/games/padracing/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ environment:

dependencies:
collection: ^1.17.1
flame: ^1.20.0
flame_forge2d: ^0.18.2+1
flame: ^1.21.0
flame_forge2d: ^0.18.2+2
flutter:
sdk: flutter
google_fonts: ^4.0.4
Expand Down
2 changes: 1 addition & 1 deletion examples/games/rogue_shooter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
flutter: ">=3.22.0"

dependencies:
flame: ^1.20.0
flame: ^1.21.0
flutter:
sdk: flutter

Expand Down
2 changes: 1 addition & 1 deletion examples/games/trex/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ environment:

dependencies:
collection: ^1.16.0
flame: ^1.20.0
flame: ^1.21.0
flutter:
sdk: flutter

Expand Down
5 changes: 5 additions & 0 deletions examples/lib/stories/sprites/sprite_batch_load_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ class SpriteBatchLoadExample extends FlameGame {

class MySpriteBatchComponent extends SpriteBatchComponent
with HasGameReference<SpriteBatchLoadExample> {
MySpriteBatchComponent()
: super(
blendMode: BlendMode.srcOver,
);

@override
Future<void> onLoad() async {
final spriteBatch = await game.loadSpriteBatch('boom.png');
Expand Down
56 changes: 47 additions & 9 deletions examples/lib/stories/system/overlays_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class OverlaysExample extends FlameGame with TapDetector {
..anchor = Anchor.center
..size = Vector2.all(100),
);

// 'SecondaryMenu' will be displayed above 'PauseMenu'
overlays.add('SecondaryMenu', priority: 1);
}

@override
Expand All @@ -45,14 +48,44 @@ class OverlaysExample extends FlameGame with TapDetector {
}
}

Widget _pauseMenuBuilder(BuildContext buildContext, OverlaysExample game) {
Widget _pauseMenuBuilder(
BuildContext buildContext,
OverlaysExample game,
GestureTapCallback? onTap,
) {
return Center(
child: Container(
width: 100,
height: 100,
color: Colors.orange,
child: const Center(
child: Text('Paused'),
child: GestureDetector(
onTap: onTap,
child: Container(
width: 100,
height: 100,
color: Colors.orange,
child: const Center(
child: Text('Paused'),
),
),
),
);
}

Widget _secondaryMenuBuilder(BuildContext buildContext, OverlaysExample game) {
return Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: 100,
height: 50,
alignment: Alignment.center,
color: Colors.red,
child: const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.music_off_rounded),
Icon(Icons.info),
Icon(Icons.star),
],
),
),
),
);
Expand All @@ -61,8 +94,13 @@ Widget _pauseMenuBuilder(BuildContext buildContext, OverlaysExample game) {
Widget overlayBuilder(DashbookContext ctx) {
return GameWidget<OverlaysExample>(
game: OverlaysExample()..paused = true,
overlayBuilderMap: const {
'PauseMenu': _pauseMenuBuilder,
overlayBuilderMap: {
'PauseMenu': (context, game) => _pauseMenuBuilder(
context,
game,
() => game.onTap(),
),
'SecondaryMenu': _secondaryMenuBuilder,
},
initialActiveOverlays: const ['PauseMenu'],
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import 'package:dashbook/dashbook.dart';
import 'package:flame/widgets.dart';
import 'package:flutter/material.dart';

var _opacity = 1.0;

Widget nineTileBoxBuilderWithAnimation(DashbookContext ctx) {
return StatefulBuilder(
builder: (context, setState) {
return Column(
children: [
const SizedBox(height: 8),
ElevatedButton(
onPressed: () {
setState(() {
_opacity = _opacity == 1.0 ? 0.0 : 1.0;
});
},
child: const Text('Toggle'),
),
const SizedBox(height: 8),
AnimatedOpacity(
duration: const Duration(seconds: 2),
opacity: _opacity,
child: NineTileBoxWidget.asset(
width: 400,
height: 400,
path: 'nine-box.png',
tileSize: 22,
destTileSize: 50,
child: const Center(
child: Text(
'Cool label',
style: TextStyle(
color: Color(0xFF000000),
),
),
),
),
),
],
);
},
);
}
10 changes: 8 additions & 2 deletions examples/lib/stories/widgets/partial_sprite_widget_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ Widget partialSpriteWidgetBuilder(DashbookContext ctx) {
decoration: BoxDecoration(border: Border.all(color: Colors.amber)),
child: SpriteWidget.asset(
path: 'bomb_ptero.png',
srcPosition: Vector2(48, 0),
srcSize: Vector2(48, 32),
srcPosition: Vector2(
ctx.numberProperty('srcPosition.x', 48),
ctx.numberProperty('srcPosition.y', 0),
),
srcSize: Vector2(
ctx.numberProperty('srcSize.x', 48),
ctx.numberProperty('srcSize.y', 32),
),
anchor: Anchor.valueOf(
ctx.listProperty('anchor', 'center', anchorOptions),
),
Expand Down
10 changes: 10 additions & 0 deletions examples/lib/stories/widgets/widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:dashbook/dashbook.dart';
import 'package:examples/commons/commons.dart';
import 'package:examples/stories/widgets/custom_painter_example.dart';
import 'package:examples/stories/widgets/nine_tile_box_example.dart';
import 'package:examples/stories/widgets/nine_tile_box_example_with_animation.dart';
import 'package:examples/stories/widgets/partial_sprite_widget_example.dart';
import 'package:examples/stories/widgets/sprite_animation_widget_example.dart';
import 'package:examples/stories/widgets/sprite_button_example.dart';
Expand All @@ -21,6 +22,15 @@ void addWidgetsStories(Dashbook dashbook) {
out the settings on the pen icon.
''',
)
..add(
'Nine Tile Box (With animation widgets)',
nineTileBoxBuilderWithAnimation,
codeLink: baseLink('widgets/nine_tile_box_example_with_animation.dart'),
info: '''
Similar to the Nine Tile Box example, but here a NineTileBoxWidget is composed
with Flutter's AnimatedOpacity.
''',
)
..add(
'Sprite Button',
spriteButtonBuilder,
Expand Down
18 changes: 9 additions & 9 deletions examples/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ environment:

dependencies:
dashbook: ^0.1.15
flame: ^1.20.0
flame_audio: ^2.10.4
flame_forge2d: ^0.18.2+1
flame_isolate: ^0.6.2+1
flame_lottie: ^0.4.2+1
flame_noise: ^0.3.2+1
flame_spine: ^0.2.2+1
flame_svg: ^1.11.1
flame_tiled: ^1.20.4
flame: ^1.21.0
flame_audio: ^2.10.5
flame_forge2d: ^0.18.2+2
flame_isolate: ^0.6.2+2
flame_lottie: ^0.4.2+2
flame_noise: ^0.3.2+2
flame_spine: ^0.2.2+2
flame_svg: ^1.11.2
flame_tiled: ^1.21.0
flutter:
sdk: flutter
google_fonts: ^4.0.4
Expand Down
Loading

0 comments on commit 2e20936

Please sign in to comment.