#Cannot for the life of me figure out how to add custom size to sprite

4 messages · Page 1 of 1 (latest)

novel delta
#

i have this sprite:

                TextureAtlasSprite {
                    color: Default::default(),
                    index: 0,
                    flip_x: false,
                    flip_y: false,
                    custom_size: ????,
                    ..Default::default()
                }```
apparently custom size needs to be an Option<Vec2> but nothing i can think of putting in this spot works, any advice?
humble drift
#

Some(Vec2::new(WIDTH, HEIGHT))

#

and you could actually do this in the Transform component instead of the sprite component if you wanted

#

ex: rs commands.spawn(SpriteBundle { .. transform: Transform { .. scale: Vec3::new(WIDTH, HEIGHT, 0.0), }, .. }); iirc this should scale it however you want