214 Commits

Author SHA1 Message Date
Lisette
8cadff21df feat: New package flame_gamepads (#3886)
Adds new package flame_gamepads. This package provides a
GamepadCallbacks mixin to use gamepads library with Flame.

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2026-03-26 07:10:25 +00:00
Lukas Klingsbo
6290b56969 ci: Only trigger docs build on doc changes or new tags (#3877)
# Description

The docs site build was triggered on every push to `main`, causing
unnecessary rebuilds. This PR moves the docs dispatch trigger into a
dedicated `docs.yml` workflow that only runs when:
- Files in `doc/**` change on `main`
- A new `v*` tag is created

The examples gh-pages deployment in `gh-pages.yml` remains unchanged.

## Checklist

- [x] I have followed the [Contributor Guide] when preparing my PR.
- [-] I have updated/added tests for ALL new/updated/fixed
functionality.
- [-] I have updated/added relevant documentation in `docs` and added
dartdoc comments with `///`.
- [-] I have updated/added relevant examples in `examples` or `docs`.

## Breaking Change?

- [ ] Yes, this PR is a breaking change.
- [x] No, this PR is not a breaking change.

## Related Issues

[Contributor Guide]:
https://github.com/flame-engine/flame/blob/main/CONTRIBUTING.md
[Conventional Commit]: https://conventionalcommits.org
[CHANGELOG]:
https://github.com/flame-engine/flame/blob/main/CHANGELOG.md
2026-03-24 09:31:53 +01:00
Lukas Klingsbo
23c33b6fa9 ci: Automate v-tag and GitHub release for flame (#3876)
Adds a new step to the `release-tag.yml` workflow that automatically:
1. Creates a short `v{version}` tag (e.g. `v1.36.0`) pointing at the
same commit as the melos-generated `flame-v{version}` tag
2. Creates a GitHub release with the flame package changelog as release
notes

This removes the manual step of creating the `v` tag and GitHub release
after each flame release.
2026-03-24 09:25:01 +01:00
Luan Nico
8986b84013 feat: Introduce flame_typled (#3862)
Add a new bridge package for
[typled](https://github.com/erickzanardo/typled).

Basically handles:
* converting from typled formats to Sprite or SpriteBatch
* supports ghost line busting out of the box!

As seen on
[sokobros](https://github.com/flame-engine/sokobros/blob/master/lib/game/assets/sprite_atlas.dart).
2026-03-20 18:17:37 -04:00
Dmitry
f393f12b71 feat: Add HueEffect and HueDecorator (#3852)
This PR adds a new 
HueEffect
to the Flame effects library. This effect allows animating the hue shift
of a component's paint over time.

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2026-03-19 11:52:50 +00:00
Lukas Klingsbo
c87324d38f docs: Improve flame documentation structure, grammar, and accuracy (#3827)
Addresses unchecked items from #2895:               
- Add introductory "why" paragraphs to each major documentation section,
with links to related Flutter/game dev concepts
- Split the monolithic components.md (1500+ lines) into focused pages
under components/
  - Fix grammar, typos, and style issues across all doc/flame/ files
- Replace deprecated gameRef with game and fix outdated Future<void>?
signature
  - Remove outdated Flutter 3.13 version reference
  - Replace all -- with proper punctuation
2026-03-02 08:01:53 +01:00
Lukas Klingsbo
97931a5936 feat: Add an IconComponent that renders IconData (#3820)
This adds a `ComponentComponent` that renders `IconData`.
It doesn't render it through the text pipeline, so we can easily add
color effects to the icons.

[Screencast from 2026-03-01
16-44-22.webm](https://github.com/user-attachments/assets/f5233d20-ec6c-45ed-9552-f23031ea47fb)
2026-03-01 21:14:30 +01:00
Lapu Kornél
c54c15fd2d docs: Added basic shader tutorial (#3799)
Added Basic Shader Tutirial to Flame documentation.
Added one note to CONTRIBUTING.md, which explains how to resolve non
UTF-8 characters in path.

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2026-03-01 18:06:56 +00:00
Arun Gopinath
f241ebd6d7 fix(flame_3d): Use float for numLights uniform to fix GLES crash (#3810)
# Description

Fixes #3809

`flame_3d` crashes on Android GLES because `spatial_material.frag`
declares `uint numLights` and `lighting_info.dart` sets it via
`shader.setUint()`. Impeller's GLES backend only supports `float`
uniforms — the `uint` path hits an unhandled shader type and crashes.

Changed `uint` → `float` in the shader and `setUint` → `setFloat` in
Dart. The value is a light count (0–3) so `float` works identically.
Recompiled the shaderbundle.

## Checklist

- [x] I have followed the [Contributor Guide] when preparing my PR.
- [ ] I have updated/added tests for ALL new/updated/fixed
functionality.
- [ ] I have updated/added relevant documentation in `docs` and added
dartdoc comments with `///`.
- [ ] I have updated/added relevant examples in `examples` or `docs`.

No test added — the crash only reproduces on a real GLES
device/emulator, not in unit tests. The existing lighting logic is
unchanged; only the uniform type is corrected.

## Breaking Change?

- [ ] Yes, this PR is a breaking change.
- [x] No, this PR is not a breaking change.

<!-- Links -->
[Contributor Guide]:
https://github.com/flame-engine/flame/blob/main/CONTRIBUTING.md

---------

Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2026-02-23 23:19:29 -05:00
Lukas Klingsbo
0d50530485 fix: Bump Flutter min version to 3.41.0 (#3807)
Bump the Flutter and dartdoc version so that we can develop with the new
Flutter version.
This aggressive bump is due to Flutter bumping dartdoc to 9.0.0.
2026-02-12 21:42:47 +01:00
Lukas Klingsbo
f57b422c96 chore: Remove unused word from dictionary (#3797) 2026-01-06 10:22:59 -03:00
github-actions[bot]
e06260d8b4 chore(release): Publish packages (#3757)
Prepared all packages to be released to pub.dev

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2025-11-03 11:10:08 +01:00
Oscar
e950d79e56 feat: Add flame_behaviors package (#3717)
Moving flame_behaviors from [VeryGoodOpenSource/flame_behaviors
repository](https://github.com/VeryGoodOpenSource/flame_behaviors)

---------

Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2025-10-06 14:32:57 +02:00
Lukas Klingsbo
5514534de3 chore: Remove unnecessary CI steps (#3738)
Since we now have shorebird CI we can remove some of our CI steps, more
of them will be possible to remove later.
2025-10-03 15:01:54 +02:00
Luan Nico
632bb6b722 ci: Update cspell used on CI to latest version (#3727)
Update cspell used on CI to latest version `9.2.1`:

https://www.npmjs.com/package/cspell

Note that the contributing guidelines does not mandate a version, so
this (the latest) will be installed if following those instructions.
2025-09-28 19:06:21 +02:00
Luan Nico
9480b9dc0b ci: Update version of the amannn/action-semantic-pull-request to v6 (#3728)
Update version of the `amannn/action-semantic-pull-request` to the
latest, v6.
2025-09-27 22:39:47 +00:00
Luan Nico
dee08210a5 ci: Fix cspell verify script to use the run script (#3730)
Fix cspell verify script to use the run script.

As part of investigating why the newest cspell version [causes
issues](https://github.com/flame-engine/flame/pull/3727) with the verify
script, I first notice that we don't run cspell with the correct flags
inside the verify script (notably not applying our own config file).

This fixes that by re-using the run script in the verify script, which
avoid repetition and future drift.

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2025-09-27 22:25:43 +00:00
Luan Nico
639df09857 ci: Fix alphabetization check in cspell verify script (#3729)
Fix alphabetization check in cspell verify script; it was using
non-bash-compliant code that would not actually work on certain systems;
in fact, it was not working on CI, which has caused some drift. This
also fixes the dictionaries.

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2025-09-27 21:35:27 +00:00
Lukas Klingsbo
1cca70e340 chore: Correctly name packages (#3721)
* The root package should be named `_` in pub workspaces that doesn't
have an actual app or package in the root.
* Melos needs to be updated to support this.
* The flame_3d example should be named flame_3d_example to follow the
convention.
2025-09-13 07:56:30 +00:00
Alp
fc983d7e1f docs: Remove the "Flame web" section in platforms.md (#3705)
Newer versions of Flutter (3.27+ according to the last link below)
default to the CanvasKit renderer, and following the instructions in
that documentation section to pass the `--web-renderer` results in the
following error (on Flame 1.32 & Flutter 3.35.2 which are the latest
versions as of this writing):
```
$ flutter build web --release --web-renderer canvaskit
Could not find an option named "--web-renderer".

Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
```

Since this section only talked about this quirk I think it's better to
remove it altogether. If there's a reason to keep it and for users of
older versions of Flutter, a note on this can be added instead.

Addresses https://github.com/flame-engine/flame/issues/3706

See Also:

- https://github.com/flutter/flutter/issues/145954

- The bottom of
https://docs.google.com/document/d/1DGamHsa2lz_Qtgfrfa3j3fRaEopJXc7tCFVM1TQlck8/edit?resourcekey=0-IjkqrCoo_EcRRS2bPYKI8w&tab=t.0

- https://stackoverflow.com/a/79522746
2025-08-27 05:57:53 +02:00
Luan Nico
918b9d59df chore: Re-enable melos analyze on CICD following Dart 3.8 migration (#3681)
Re-enable melos analyze on CICD following Dart 3.8 migration.
2025-08-10 14:42:59 -04:00
Luan Nico
b79fee0ae2 chore: Update min Dart constraint to 3.8 (#3676)
Update min Dart constraint to 3.8, which will enable us to use the
fancier collection literals.

This requires bumping the min Flutter version as well:

<img width="1892" height="1122" alt="image"
src="https://github.com/user-attachments/assets/7c7b07fc-4d96-4987-824d-9a7133ecfb85"
/>
2025-08-10 12:42:31 -04:00
Luan Nico
cc58aef5b5 feat: Add support for model parsing and rendering in flame_3d, including skeletal animations (#3675)
Add support for model parsing and rendering in flame_3d, including
skeletal animations (literally!):

<img width="1902" height="1426" alt="image"
src="https://github.com/user-attachments/assets/442e4738-6ff2-415a-8174-9775f18754ce"
/>
2025-08-10 11:42:05 -04:00
Erick
6fd36bc1d8 feat: Implement measure to fix ghost lines and graphical artifacts in Sprites (#3590)
Adds features to easily help users to get rid of "ghost lines" and
"texture leak artifacts":
 - Bleed support on sprites
 - Ability to raster Sprite into memory.

---------

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2025-06-10 14:15:52 -03:00
Lukas Klingsbo
26c0d78f12 chore: Fix analyze issues for 3.32.0 (#3605)
Just fixing up some small analyzer issues that popped up in 3.32.0
2025-05-21 19:43:33 +02:00
Lukas Klingsbo
d753a3873c ci: Remove benchmark action until results are more stable (#3603)
Removes the benchmark action until is gives more stable results.
It can still be run locally.
2025-05-19 16:06:29 +00:00
Lukas Klingsbo
2711572952 fix: Add fragment shader extension from flutter_shaders (#3578)
This adds the fragment shader extension from flutter_shaders.
It allows for setting uniforms in a more convenient way.
2025-04-22 20:34:42 +02:00
Renan
c3316ae4a5 feat: Post Process API (#3404)
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2025-04-18 14:19:43 +00:00
Lukas Klingsbo
80a598cd00 fix: The SpriteButton label should be nullable (#3557)
Sometimes all you need to display are within the assets, then there is
no need for a widget label.
2025-04-13 19:24:56 +00:00
zeyus
47fe30dfc9 test: Intermittently failing test due to Float32 prcision (#3556)
Random number generation resulted in occasional errors with the expected
tolerance of specifically the transform2d test. This follows on from the
previous pr #3515

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2025-04-11 11:55:21 +00:00
Lukas Klingsbo
ba2efcd6cf chore: Loosen up constraints on PR title (#3550)
This enables us to start PR titles with other characters than capital
ones.
2025-04-03 17:43:22 +00:00
Luan Nico
c2afe11f2c fix: Fix priority rebalancing causing concurrent mutation of component ordered_set (#3530)
Fix priority rebalancing causing concurrent mutation of component
ordered_set.

This fixes https://github.com/flame-engine/flame/issues/3363

Basically priority changes and rebalancing was not using the component
lifecycle event queue, which caused concurrent mutations and iterations
of the component set, and due to race conditions, loss of components as
they are removed and re-added for rebalancing.

The issue is not with ordered_set itself, but rather how it is being
used. It was never designed to support concurrent mutations.

A few notes for the future:

* I think we should consider changing the whole event (input) system so
that every event is queued and only processed predictably within the
game loop, avoiding a whole class of concurrent modification issues
* we should consider more efficient ways of rebalancing than literally
removing every single component + re-adding (which is also error prone
if there is concurrent access).

---------

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2025-03-21 22:06:20 +00:00
Lukas Klingsbo
f66a920159 chore: Don't compile examples to wasm (#3527)
Since flame_spine is using ffi we can't compile the examples to wasm.
2025-03-13 03:20:16 +00:00
Lukas Klingsbo
ccb5cf0c44 chore: Remove deprecated gh-pages build argument (#3526)
The web-renderer isn't needed anymore, and let's try to use the wasm
compiler for the examples by default.
2025-03-13 03:05:20 +00:00
August
d5ae35f2bb refactor(flame_audio): Set AudioContext for AudioPool only (#3511)
Take advantage of the changes in
https://github.com/bluefireteam/audioplayers/pull/1890

---------

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2025-02-27 02:28:10 +00:00
Liv Tan Ong
678cf05780 feat: Layout Components (#3507)
Laying out of game UI elements in a column or a row is fairly common,
such as for menus, or even HUD buttons.
This PR attempts to create basic layout components that fulfill this
purpose.

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2025-02-27 02:19:12 +00:00
August
762e0ad842 feat(audio): Set audio context AudioContextConfigFocus.mixWithOthers by default (#3483)
# Description

AudioPlayers used to mix their sounds with other audio on the device,
which is not the proposed experience on Mobile devices. So this behavior
was changed in AudioPlayers, but it wasn't enforced due to a bug.
Obviously this behavior is not wanted for Games as multiple sounds
should play simultaneously, so this recovers the old functionality
again.

## Checklist
<!--
Before you create this PR confirm that it meets all requirements listed
below by checking the
relevant checkboxes with `[x]`. If some checkbox is not applicable, mark
it as `[-]`.
-->

- [x] I have followed the [Contributor Guide] when preparing my PR.
- [ ] I have updated/added tests for ALL new/updated/fixed
functionality.
- [ ] I have updated/added relevant documentation in `docs` and added
dartdoc comments with `///`.
- [x] I have updated/added relevant examples in `examples` or `docs`.

Not sure, if I can test this properly, as it's on a system level. I
could ensure the values are set though (?)

## Breaking Change?
I'm actually not sure, if this is breaking, I think it's not, as
`audioplayers` used to work like `mixWithOthers` due to a bug, but is
not anymore.

- [ ] Yes, this PR is a breaking change.
- [x] No, this PR is not a breaking change.

<!--
### Migration instructions

If the PR is breaking, uncomment this header and add instructions for
how to migrate from the
currently released version in-between the two following tags:
-->
<!-- End of exclude from commit message -->

---------

Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
2025-02-10 08:46:54 +00:00
Lukas Klingsbo
324ac2bfc2 fix: Don't use a future when assets for SpriteButton is already loaded (#3456)
When both images are already loaded and we're using a future it will go
into loading for one tick, with this PR we avoid that.
2025-01-26 16:47:48 +01:00
Luan Nico
9238f7fe73 chore: Update dart-benchmark-action to v0.1.14 (#3452)
Update dart-benchmark-action to v0.1.14
2025-01-21 07:36:53 +01:00
Luan Nico
2d4ececbdf test: Ensure correct permissions for any author on dart_benchmark_action config (#3442)
Ensure correct permissions for any author on dart_benchmark_action
config.
2025-01-09 21:39:38 +00:00
Lukas Klingsbo
9bcef051db ci: Use melos v7.0.0-dev.1 (#3433)
This makes the monorepo make use of `Melos v7.0.0-dev.1` so that we can
use the pub workspaces feature.
2025-01-07 22:11:40 +01:00
Luan Nico
4af202faf5 test: Add very basic benchmark infrastructure (#3431)
Add very basic benchmark infrastructure, using the `examples` app as a
centralized benchmark playground and with first ever benchmark file just
testing some components and updates (more to come).

This also sets up the `dart-benchmark-action` to run, starting on this
very PR!
2025-01-07 08:00:03 +01:00
Luan Nico
1f9b0ea9f3 feat: Add support for strike-through text for flame_markdown (#3426)
Add support for strike-through text for flame_markdown, if enabled by
the user.

Basically parses the `del` HTMl tag and maps it to a new inline text
renderer in Flame's text rendering pipeline.

The style can be controlled with a new property if desired.

In order to parse `~~`-wrapped text into the new node element, the
underlying markdown parser must have the strikethrough option enabled
(or an equivalent custom option), which can be controlled by the user if
providing their own document.
2024-12-29 07:52:53 -08:00
Erick
de74a93b44 feat: Refactoring flame_console to use terminui (#3388)
Simplify flame_console to use `terminui` instead of implementing the
terminal interface itself.
2024-12-16 12:00:26 -03:00
Mike Diarmid
978ad31b42 refactor: Fix lint issues from latest flutter release (#3390)
Updates to use the new color method `withValues`.

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2024-12-13 22:40:54 +01:00
Luan Nico
f5f03e5ed7 feat: Add more useful extensions to VectorN and Quaternion [flame_3d] (#3296)
Add more useful extensions to VectorN and Quaternion
2024-12-11 14:26:29 -05:00
Luan Nico
5c508e81bd feat: More Lights! [flame_3d] (#3250)
More Lights! More fun!

I am still trying to get arrays to work (not even the fancy SSBOs, just
plain fixed arrays).

In the meanwhile this puts lights as separate objects.

This supports:

* point lights
* ambient lights
* colors
* intensity


![image](https://github.com/user-attachments/assets/a2f75a8a-9c64-42d1-bbe5-bdf58fa7df69)

---------

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2024-12-11 14:26:29 -05:00
Jochum van der Ploeg
4042d3002c feat(flame_3d): Make shader api more useful (#3085)
Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2024-12-11 14:26:29 -05:00
Luan Nico
a2cc332161 chore: Bump min supported Flutter version to match stable (#3368)
Bumps min flutter version to 3.24 (stable is at 3.24.5 already).
This allows us to finally merge flame_3d in.
2024-12-10 15:59:23 +00:00
Anthony Taormina
8d6a5bb0c2 docs: Fix typo in bug report (#3369)
Fixing a typo I found when submitting a bug.
2024-11-17 23:26:16 +01:00