Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/circuitsuffering/bevy_shape_transition
https://github.com/circuitsuffering/bevy_shape_transition
bevy bevy-engine
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/circuitsuffering/bevy_shape_transition
- Owner: CircuitSuffering
- Created: 2024-11-22T04:44:49.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-11-22T07:00:25.000Z (about 1 month ago)
- Last Synced: 2024-11-22T07:30:03.650Z (about 1 month ago)
- Topics: bevy, bevy-engine
- Language: Rust
- Homepage:
- Size: 1.82 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# bevy_shape_transition
## Description
This crate provides a way to transition between colors/screens in a Bevy game using shapes.
## Usage
Add the following to your `Cargo.toml` file:
```toml
[dependencies]
bevy_shape_transition = { git = "https://github.com/circuitsuffer-studios/bevy_shape_transition" }
```## Examples
### Left Right
### Party
> [!NOTE]
> Gif is too big### Usage
Add the plugin:
```rust
use bevy::prelude::*;
use bevy_shape_transition::prelude::*;fn main() {
App::new()
.add_plugins((DefaultPlugins, TransitionPlugin))
.add_systems(Startup, setup)
.add_systems(Update, update)
.run();
}
```Spawn a transition:
```rust
fn update(
mut events: EventWriter,
keyboard_input: Res>,
mut color: Local
) {
// color swap
let color1 = Color::rgb(0.0, 0.0, 0.0);
let color2 = Color::rgb(1.0, 1.0, 1.0);
*color = if *color == color1 { color2 } else { color1 };// spawn transition
if keyboard_input.just_pressed(KeyCode::Space) {
events.send(NewTransition {
angle: 0.0,
color,
duration: 1.8,
ease: EaseFunction::QuarticIn,
});
}
}
```