Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ickshonpe/bevy_image_config
Bevy plugin that loads and applies image settings automatically if they have an accompanying configuration file.
https://github.com/ickshonpe/bevy_image_config
Last synced: about 1 month ago
JSON representation
Bevy plugin that loads and applies image settings automatically if they have an accompanying configuration file.
- Host: GitHub
- URL: https://github.com/ickshonpe/bevy_image_config
- Owner: ickshonpe
- License: other
- Created: 2022-10-11T10:50:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-12T12:22:19.000Z (about 2 years ago)
- Last Synced: 2024-11-16T18:43:27.766Z (about 2 months ago)
- Language: Rust
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# bevy_image_config
[![crates.io](https://img.shields.io/crates/v/bevy_image_config)](https://crates.io/crates/bevy_image_config)
[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/ickshonpe/bevy_image_config)
[![crates.io](https://img.shields.io/crates/d/bevy_image_config)](https://crates.io/crates/bevy_image_config)Bevy plugin that automatically loads and applies image sampler settings for image assets from an accompanying configuration file.
## Usage
Add the dependency to `Cargo.toml`:
```toml
bevy_image_config = "0.2"
```Add the plugin to your app:
```rust
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:
* address_mode_u, address_mode_v, address_mode_w:
```
ClampToEdge | Repeat | MirrorRepeat | ClampToBorder
```
* min_filter, mag_filter, mipmap_filter:
```
Nearest | Linear
```
* lod_min_clamp: `f32`,
* lod_max_clamp: `f32`,
* compare:
```
Option of Never | Less | Equal | LessEqual | Greater | NotEqual | GreaterEqual | Always
```
* anisotropy_clamp: `Option`,
* border_color:
```
Option of TransparentBlack | OpaqueBlack | OpaqueWhite | Zero
```## Examples
```
cargo run --example example
```