1 unstable release
Uses new Rust 2024
0.1.0 | Dec 20, 2024 |
---|
#943 in Game dev
49KB
85 lines
Provides Unity style button interactions
Currently supports color tinting and image swapping.
Getting started
Import the crate to bring all necessary types into scope:
use bevy_button_transitions::*;
Add ButtonTransitionsPlugin
to setup the system:
app.add_plugins(ButtonTransitionsPlugin);
Add the ButtonTransition
component to your buttons
commands.spawn((
ButtonTransition::ColorTint(ColorTint::default()),
ImageNode {
image: asset_server.load("normal_image.png"),
..default()
},
Node {
width: Val::Px(250.0),
height: Val::Px(80.0),
..default()
},
));
Be aware that the color tint button transition needs an image to tint!
bevy_button_transitions
A simple button transition component (less than 100 lines of code). Supports image swapping and color tinting like Unity does.
Supported Bevy Versions
Bevy | bevy_button_transitions |
---|---|
0.15 | 0.1 |
ToDo
- Support Animations
- Remove unnecessary dependencies (currently uses bevy as whole, which might not be needed)
- currently needs reflection, which might be unnecessary
Dependencies
~24–35MB
~575K SLoC