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>
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>
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>
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>
# 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>
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!
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.
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>
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

---------
Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
With this PR we'll be able to publish by running an action from the
Actions tab which will create a release PR that we can review and when
that PR is merged it will tag all new packages and trigger release
workflows for them.
Fix text rendering issue where spaces end up missing.
What happens is that if a single paragraph is split into multiple spans,
due to having different formatting, for example, the layouting engine
will run into an edge case when trying to place the last span. It will:
* split it and try to put each word at a time with the preceding space
* it will eventually find a word that cannot fit, and return to a
partial state
* however, the layouting engine then keeps going and try the same
element again. that is because there could be more elements, and the
engine conflates bits and elements
* now the element "starts" at the next word, and suddenly it fits,
because a new space is not added. this only happens if the final word is
such that it fits by itself but doesn't with the leading space.
That is not normally an issue because if it doesn't fit, it will go to
the next line and the space becomes unnecessary in that case. But in
case we are still trying to populate the same line, we need to make sure
we don't "eat up" the space.
There could be other similar edge cases where a space could go missing,
so I opted to make it explicit whether the initial space should be added
or not by adding a parameter to determine if it is the start of a new
line or not.
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.
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>