Bevy: Change Scale component from Scale(f32) to Scale(Vec3)

Created on 18 Aug 2020  路  4Comments  路  Source: bevyengine/bevy

Other game engines have scale as Vector3, as there are many usecases where you only want to scale a single dimension. I think this should be a fairly simple change to make.

documentation ecs

Most helpful comment

I wonder if it would make sense to add a #[bundle(option)] attribute in #[derive(Bundle)] to make optional components work.
Alternatively, #[bundle(either)] with a custom Either enum. But that wouldn't nest anyway.

All 4 comments

There is a NonUniformScale type too that has 3 components, that should work I think.

I'll mark this as documentation because I think this needs to be made more visible, this is not the first time this came up.

If NonUniformScale does not work for you then let me know and I'll re-tag this issue.

Thanks @karroffel! It does work with one nitpicky caveat.

Quite a bunch of bundled components are bundling Scale in. Is there a way to override it? I tried slapping NonUniformScale on top and it just breaks all transformations. Of course, I could just copy paste the SpriteSheetComponents and the defaults provided and make my own bundle, but I'll end up with quite a bunch of duplicated code by doing this if I wish to always use NonUniformScale!

I wonder if it would make sense to add a #[bundle(option)] attribute in #[derive(Bundle)] to make optional components work.
Alternatively, #[bundle(either)] with a custom Either enum. But that wouldn't nest anyway.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

erlend-sh picture erlend-sh  路  5Comments

rod-salazar picture rod-salazar  路  4Comments

TehPers picture TehPers  路  4Comments

navaati picture navaati  路  5Comments

TheArchitect4855 picture TheArchitect4855  路  3Comments