Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Bevy Sprite Animations
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Bevy Sprite Animations
Commits
f6f10087
Verified
Commit
f6f10087
authored
6 months ago
by
Louis
Browse files
Options
Downloads
Patches
Plain Diff
Fix missing system for directional override animations
parent
167be828
Branches
trunk
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+24
-4
24 additions, 4 deletions
CHANGELOG.md
Cargo.toml
+2
-2
2 additions, 2 deletions
Cargo.toml
src/query.rs
+55
-0
55 additions, 0 deletions
src/query.rs
src/systems.rs
+4
-3
4 additions, 3 deletions
src/systems.rs
with
85 additions
and
9 deletions
CHANGELOG.md
+
24
−
4
View file @
f6f10087
# Changelog
All notable changes to this project will be documented in this file.
The format is based on
[
Keep a Changelog
](
https://keepachangelog.com/en/1.0.0/
)
,
and this project adheres to
[
Semantic Versioning
](
https://semver.org/spec/v2.0.0.html
)
.
## [0.9.2]
### Fixed
-
Directional override animations were being skipped by the override animation filters
-
Relational sync was being scheduled in the same set as animation ticks, potentially causing 1-frame desync based on
Bevy scheduling
## [0.9.0]
### Changed
-
Required Bevy version is now 0.14
## [0.8.0]
### Changed
-
Required Bevy version is no
t
0.13
-
Required Bevy version is no
w
0.13
## [0.7.0]
...
...
@@ -23,10 +38,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed
-
`AnimationQuery`
has been removed; instead, the ergonomics of controlling animations by manipulating components
directly is much more ergonomic
-
`AnimationQuery`
has been removed; instead, the ergonomics of controlling animations by manipulating components
directly is much more ergonomic
-
Support for
`bevy_ecs_tilemap`
has been dropped
-
-
## [0.6.0]
...
...
@@ -45,19 +60,23 @@ directly is much more ergonomic
## [0.3.1]
### Fixed
-
Child animations would not play correct animation when parent has an override
## [0.2.1]
### Fixed
-
Action animation frames overflow
## [0.2.0]
### Added
-
Constructor functions for
`AnimationOverride`
### Changed
-
`bevy`
version
`0.9`
-
`bevy_ecs_tilemap`
version
`0.9`
-
`AnimationOverride`
now contains its own state
...
...
@@ -69,4 +88,5 @@ directly is much more ergonomic
## [0.1.1]
### Fixed
-
"play once and then" animations could overflow frame array bounds
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Cargo.toml
+
2
−
2
View file @
f6f10087
[package]
name
=
"micro_banimate"
version
=
"0.9.
1
"
version
=
"0.9.
2
"
edition
=
"2021"
license
=
"Apache-2.0"
description
=
"Easily manage complex Bevy 2D sprite animations"
authors
=
[
"Louis Capitanchik <louis@microhacks.co.uk>"
"Louis Capitanchik <louis@microhacks.co.uk>"
]
repository
=
"https://lab.lcr.gr/microhacks/micro-banimate"
...
...
This diff is collapsed.
Click to expand it.
src/query.rs
+
55
−
0
View file @
f6f10087
...
...
@@ -37,6 +37,16 @@ pub struct OverrideAnimationComponents {
atlas
:
&
'static
mut
TextureAtlas
,
}
#[derive(QueryData)]
#[query_data(mutable)]
pub
struct
DirectionalOverrideAnimationComponents
{
handle
:
&
'static
Handle
<
AnimationSet
>
,
direction
:
&
'static
Directionality
,
data
:
Option
<&
'static
OverrideData
>
,
status
:
&
'static
mut
AnimationOverride
,
atlas
:
&
'static
mut
TextureAtlas
,
}
#[derive(QueryData)]
#[query_data(mutable)]
pub
struct
SimpleAnimationComponents
{
...
...
@@ -193,6 +203,51 @@ pub fn play_override_animation(
}
}
pub
fn
play_directional_override_animation
(
time
:
Res
<
Time
>
,
mut
commands
:
Commands
,
mut
anim_query
:
Query
<
(
Entity
,
DirectionalOverrideAnimationComponents
),
OnlyDirectionalOverrideAnimations
,
>
,
animations
:
Res
<
Assets
<
AnimationSet
>>
,
mut
events
:
EventWriter
<
AnimationCompleted
>
,
)
{
let
delta
=
time
.delta
();
for
(
entity
,
DirectionalOverrideAnimationComponentsItem
{
mut
status
,
direction
,
handle
,
mut
atlas
,
data
,
},
)
in
&
mut
anim_query
{
let
anim
=
get_current_anim!
(
animations
,
handle
,
format!
(
"{}_{}"
,
status
.active_name
,
direction
),
status
.active_name
);
let
looped
=
tick_animation!
(
delta
,
anim
,
status
,
atlas
);
if
looped
{
commands
.entity
(
entity
)
.remove
::
<
(
AnimationOverride
,
OverrideData
)
>
();
if
let
Some
(
data
)
=
data
{
events
.send
(
AnimationCompleted
{
entity
,
user_data
:
**
data
,
});
}
}
}
}
pub
fn
play_simple_animation
(
time
:
Res
<
Time
>
,
mut
anim_query
:
Query
<
SimpleAnimationComponents
,
Without
<
AnimationPaused
>>
,
...
...
This diff is collapsed.
Click to expand it.
src/systems.rs
+
4
−
3
View file @
f6f10087
use
crate
::
query
::{
play_animations
,
play_directional_animations
,
play_
override_animation
,
play_simpl
e_animation
,
sync_child_animation
,
play_animations
,
play_directional_animations
,
play_
directional_overrid
e_animation
,
play_override_animation
,
play_simple_animation
,
sync_child_animation
,
};
use
bevy
::
prelude
::
*
;
...
...
@@ -34,9 +34,10 @@ impl Plugin for AnimationSystemsPlugin {
play_animations
,
play_override_animation
,
play_directional_animations
,
play_directional_override_animation
,
play_simple_animation
,
)
.in_set
(
AnimationSystems
::
Sync
Animations
),
.in_set
(
AnimationSystems
::
Tick
Animations
),
)
.add_systems
(
PostUpdate
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment