-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
SpriteComponents with texture doesn't respect size #411
Comments
This is because of this system: bevy/crates/bevy_sprite/src/sprite.rs Lines 21 to 34 in 57177c9
|
@TheNeikos well, then I guess the question is - is this an expected behavior. |
I would even go as far as that only the sprite size is important and that the dev should always fill it. |
Maybe there is a way to save current behavior as default one, but also fixing it when developer specifies an actual size? Like using some trait like |
I think the size could be made into an enum: enum Size {
Manual(f32, f32),
Computed(f32, f32),
Undefined,
} This way the system seen here (#411 (comment)) will only assign a new size when it is Computed or Undefined making the intent clear. It would also default to An alternative would also be to mark the enum ResizeBehavior {
Fixed,
Automatic,
} which could then be checked, and if its automatic then the size is overwritten if the Handle changes. |
This doesn't seem to work well with shader bindings system. Just like with the traits :)
This worked pretty good. |
Closed by #430 |
Platform:
macOS 10.15.4 / iOS 13.6
Description:
Using
SpriteComponents
with texture and specific size value doesn't change the way sprite is rendered.Using only color for
ColorMaterial
renders sprite correctly.Using
scale
works for both texture and color, but color requires size being specified.Example:
Texture:
Color:
The text was updated successfully, but these errors were encountered: