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
Feature request: Allow texture indexing for TextureAtlases built through TextureAtlasBuilder #112
Comments
I actually just made something in my fork of this repo that might help. It adds a
|
This looks like it could help, thanks! I might use this once I inevitably refactor my level code again. |
@Seldom-SE I actually just published this in its own crate so it can be used in a more general sense (not just for |
This is very helpful, thanks! I'm partway transitioned to using it now. I'll leave this issue open, though, in case they want to come to their own solution. |
The plan currently is to switch to a texture array. When I do that I can leverage mipmaps(when bevy comes up with a solution for these) and texture filtering. Things that you cannot easily use with an atlas. |
I'm going to close this as there is now a |
Wow I just realized that it was sneaked in via the rebase in #120. Sorry if you didn't actually want it, had no idea it did that 😅 |
It's all good I think its still useful as I'm leaning towards making the texture array stuff all internal and users just use atlases with the API. |
Unless I am mistaken, when using a
TextureAtlas
built with aTextureAtlasBuilder
as a tilemap's texture atlas, theTile
s'texture_index
es do not map to theTextureAtlasSprite
s'index
es of the same texture. This means that attempting to use indexes retrieved throughtexture_atlas.get_texture_index
in aTile
results in unpredictable textures being displayed. And since the order of the sprites in a generatedTextureAtlas
cannot be known until runtime, usingTextureAtlasBuilder
withbevy_ecs_tilemap
is infeasible. I wrote a simple example to demonstrate this issue: https://github.com/Seldom-SE/bevy_ecs_tilemap-TextureAtlas-demo.Perhaps a method may be added to
LayerBuilder
to provide aHandle<TextureAtlas>
, so theTextureAtlas
's indexing may be used instead. Unfortunately, this could conflict with thematerial_handle
passed intomap_query.build_layer
.I am willing to contribute work on this, if it is desired. Thanks!
The text was updated successfully, but these errors were encountered: