support configuring asset settings in BSN
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## What problem does this solve or what need does it fill?
It would be nice to be able to configure loader settings with asset in BSN.
## What solution would you like?
```rust
Something like this:
bsn! {
TilemapChunk {
tileset: asset_with_settings(
"images/tileset.png",
|settings: &mut ImageLoaderSettings| {
// ...
}
),
chunk_size: { chunk_size },
tile_display_size: UVec2::splat(20),
}
}
```
## What alternative(s) have you considered?
After further consideration, I think using a meta file seems like a good alternative. But we may need a way to write the customized loader settings to meta file more than a default one.
## Additional context
I have tried to add a new variant in `HandleTemplate` and the associated helper function.
```rust
enum HandleTemplate {
// ...
PathWithSettings(AssetPath<'static>, Arc, PhantomData),
}
```
But the it is referenced in `AssetApp::register_asset_reflect` as `type_registry.register::>();`
I'm not sure what is the proper workaround for it.
Contributor guide
Research direction
Start by reading the BSN asset example and the HandleTemplate references, especially AssetApp::register_asset_reflect and its type registration. Compare the proposed asset_with_settings approach with the meta-file alternative. Done means the supported design for customized loader settings is established and works through BSN without breaking asset reflection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100