Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect texture size from assets #87

Closed
alice-i-cecile opened this issue Aug 24, 2021 · 2 comments
Closed

Detect texture size from assets #87

alice-i-cecile opened this issue Aug 24, 2021 · 2 comments
Labels
usability Improve the ergonomics of the end user API

Comments

@alice-i-cecile
Copy link
Collaborator

Setting the texture size manually (on a per-layer basis) is somewhat error-prone, and silently results in strange errors and aberrations if the user gets it wrong.

Ideally, this would be detected automatically based on the tile assets chosen (and the material handle passed in).

@alice-i-cecile
Copy link
Collaborator Author

Trying my hand at this, this is surprisingly involved / frustrating. The core issue is that we're working with Handle<ColorMaterial>> in most places, and the size is stored on the Texture currently.

This means that we're forced to use several layers of indirection, piping everything through the entire logic stack and further bloating things like MapQuery to store more Assets resources which we use to look up the information we need.

In the new renderer, this information will be stored on a new Image type: see bevyengine/bevy#2632.

My initial work can be found at https://github.com/alice-i-cecile/bevy_ecs_tilemap/tree/detect-size; anyone who's interested can pick this up / poke around and work off my branch freely, but I'm going to put this down for now and try to clean up the architecture a bit / wait for the rendering rework to drop.

@alice-i-cecile alice-i-cecile added usability Improve the ergonomics of the end user API and removed enhancement New feature or request labels Sep 9, 2021
@StarArawn
Copy link
Owner

This is now reality! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability Improve the ergonomics of the end user API
Projects
None yet
Development

No branches or pull requests

2 participants