Crates.io | bevy_image_config |
lib.rs | bevy_image_config |
version | 0.2.0 |
source | src |
created_at | 2022-10-11 20:46:11.303705 |
updated_at | 2022-10-12 12:23:39.527447 |
description | Bevy plugin that automatically configures image assets when they load |
homepage | |
repository | https://github.com/ickshonpe/bevy_image_config |
max_upload_size | |
id | 685577 |
size | 90,628 |
Bevy plugin that automatically loads and applies image sampler settings for image assets from an accompanying configuration file.
Add the dependency to Cargo.toml
:
bevy_image_config = "0.2"
Add the plugin to your app:
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugin(bevy_image_config::ImageConfigPlugin)
// ..rest of app
.run()
}
If you have an image file "image_file_name.img_ext" and a configuration file "image_file_name.img_cfg" in the same directory, the plugin will automatically load and apply the settings from "image_file_name.img_cfg.ron" when you load "image_file_name.img_ext".
The available settings are:
ClampToEdge | Repeat | MirrorRepeat | ClampToBorder
Nearest | Linear
f32
,f32
,Option of Never | Less | Equal | LessEqual | Greater | NotEqual | GreaterEqual | Always
Option<NonZeroU8>
,Option of TransparentBlack | OpaqueBlack | OpaqueWhite | Zero
cargo run --example example