Replies: 2 comments
-
There is this comment on Image: Assuming there isn't an easier way we are just missing then at a minimum an accessor to get the size from Image would make this feel a lot less gross. I imagine that is going to be one of the most common reasons people are drilling down into texture_descriptor. |
Beta Was this translation helpful? Give feedback.
0 replies
This comment was marked as spam.
This comment was marked as spam.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a convenient way in Bevy 0.6+ to determine the size of a sprite after its creation? I'm using the term "sprite" generically here to refer to any
SpriteBundle
, textured or untextured, with or withoutcustom_size
.Prior to Bevy 0.6, one would control the size of an untextured sprite through the sprite's
size
field, and this field was also updated automatically by sprite_system when textures were used.The only collision detection we show in our examples uses "sprite size" and users are often learning by building up from our examples, and a common sticking point is colliding one "sprite type" with another. If a user also needs the size of a
SpriteSheetBundle
, that's another can of worms I'll skip over for now.This is what is currently required to robustly determine the size of a
SpriteBundle
:Beta Was this translation helpful? Give feedback.
All reactions