The ClipComponent factory Constructor "circle", "rectangle" and
"polygon" are now redirect Constructor while they persist their previous
behaviour and syntax.
This allows subclasses of ClipComponent to directly address them.
```dart
/// Examples:
SubClass.fancyShape() : super.polygon();
Smiley() : super.circle();
```
---------
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
This PR adds a new method to the `SpriteBatch` class which allow users
to replace the information, based on an index of the batch.
This is useful when you want to change some of the rendering calls
without having to rebuild the whole batch.
---------
Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
Assignment of the game property on Components using
RiverpodComponentMixin was being performed inside the onLoad method,
meaning if components were unmounted and mounted once again, attempts to
invoke callbacks to the GameWidget's build method would throw an
exception.
This functionality has been moved to the onMount method, where it always
should have been.
Changes to how support for manual listeners is implemented in
flutter_riverpod 2.5.1 (released 4 days ago) have affected
flame_riverpod - specifically, the implementation of
ProviderSubscription.
This PR updates the implementation of manual listeners in flame_riverpod
in the same manner that flutter_riverpod has.
The unused fields of "SpriteWidget", "srcPosition" and "srcSize" and
their matching parameter in the default constructor has been removed.
If SpriteWidget is used, remove the parameter srcPosition and srcSize as
they have not been used in the default constructor.
(This does not belong to SpriteWidget.asset())
Clamp opacity set by the ColorEffect to 1.0; this was causing an issue
when the tween returned values greater than 1.
The test shows that when dt is greater than 0.5 and less than 0.75 for a
period of 1 the tween returns approx 1.2 which causes Color to throw an
exception.
This has now been fixed.
Since https://github.com/flutter/flutter/issues/89433 has also now been
fixed, I have changed the min opacity to 0.

This adds a structure and some basic functionality for the Flame
devtools extension.
Later I will add a pre/post-hook for publishing to Melos so that it can
build the devtools extension before publishing (and remove the directory
afterwards), since it isn't committed to this repository. For now one
has to run `melos devtools-build` before publishing.
---------
Co-authored-by: Renan <6718144+renancaraujo@users.noreply.github.com>
Co-authored-by: Erick <erickzanardoo@gmail.com>
I received an assertion error after I set `autoResize` to true when I am
using `SpriteComponent.fromImage` component. It's kinda weird for me
that the message tells me **"If size is set, autoResize should be false
or size should be null when autoResize is true.''**, but the thing is I
never set the size for that image yet. Then, I check the code and I
found out that the size will never be null anyway, so the `autoresize`
should always be false.
In this PR, I just remove all the fallback value for `size`, so it would
not give an assertion error when `size` is not being set yet while the
`autoresize` is true.
---------
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
Adding a child component to a parent which is in `removing` state,
caused the lifecycle processing to go into a cyclic dependency when the
parent is re-added. It happens because, while processing the lifecycle
events, child's add event causes itself and the parent to get added to
the blocked list. As a result of this, when the parent's add event is
processed next, it gets skipped due to being in the blocked list.
This PR makes sure that the child does not get enqueued when parent is
about to be removed.
This PR adds an extension on `TiledObject` to allow getting the object's
`position` and `size` as `Vector2` objects.
---------
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
This PR's main aim is to fix the validation errors (seen
[here](https://github.com/flame-engine/flame/blob/main/.github/ISSUE_TEMPLATE/bug_report.yml))
within the bug report yaml to make this a valid form based on GitHubs
schema.
That being said, the main changes are:
- Ensure each form has a unique ID
- A proposal to change the "affected platforms" from a textarea to a
dropdown
- Small phrasing changes, happy to revert if needed.
The documentation regarding the widgets are so outdated and it is very
confusing for a beginner like me. So, I update them to make it easier
for others to follow.
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
```
The following 18 packages will be updated:
Package Name Current Version Updated Version Update Reason
flame 1.14.0 1.15.0 updated with minor changes
flame_isolate 0.5.0+7 0.5.1 updated with minor changes
flame_noise 0.1.1+12 0.2.0 updated with major changes
flame_riverpod 5.1.5 5.2.0 updated with minor changes
flame_test 1.15.3 1.15.4 updated with patch changes
flame_texturepacker 2.1.0 3.0.0 updated with major changes
flame_oxygen 0.1.9+7 0.1.9+8 dependency was updated
flame_tiled 1.18.3 1.18.4 dependency was updated
flame_fire_atlas 1.4.7 1.4.8 dependency was updated
flame_audio 2.1.7 2.1.8 dependency was updated
flame_spine 0.1.1+9 0.1.1+10 dependency was updated
flame_bloc 1.10.9 1.10.10 dependency was updated
flame_rive 1.9.10 1.9.11 dependency was updated
flame_lottie 0.3.0+7 0.3.0+8 dependency was updated
flame_markdown 0.1.1+7 0.1.1+8 dependency was updated
flame_forge2d 0.16.0+4 0.16.0+5 dependency was updated
flame_svg 1.8.9 1.8.10 dependency was updated
flame_network_assets 0.2.0+12 0.2.0+13 dependency was updated
```
Fix positioning of git commit message exclusion blocks in the PR
template. I found it a bit confusing as I think what we want to
encourage is that the migration instructions go into the git message,
but rn there is just a "Replace or remove this text." lost after the
related issues. I don't think we want to include related issues? So it
seems just out of order.
---------
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
Update flame_noise to use the latest version of fast_noise, basically
replacing the Perlin-specific effect controller with a generic
`NoiseEffectController` that can take in any noise class (leveraging the
new Noise2 interface).
Just update from `PerlinNoiseEffectController` to
`NoiseEffectController` and provide the noise/parameters you want
directly into the `noise` field.
---------
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
Fix warnings and lint issues across the codebase.
This includes:
* equals should now be Object instead of dynamic (and thus we don't need
_help.dart anymore)
* the `always_require_non_null_named_parameters` lint rule is removed
* the `avoid-banned-imports` rule from DCM actually doesn't do anything
unless configured
Previously if you replaced a sprite in a `SpriteButtonComponent` with
`component.button = ...` it didn't update the button visually since the
`sprites` map wasn't updated, this PR solves that.