Get sprite sizes #2603
Unanswered
HotSammiches
asked this question in
Q&A
Replies: 3 comments 11 replies
-
you can get it from the Sprite Component https://docs.rs/bevy/0.5.0/bevy/prelude/struct.Sprite.html |
Beta Was this translation helpful? Give feedback.
2 replies
-
I believe you should be able to get the size from the texture (well, the texture handle) after it's been loaded. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Can you provide some code for what you are trying to accomplish? |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the best way to get the size of a sprite once it's been loaded? For example, once I have a sprite_bundle with a given transform how can I get the sprite's x and y sizes? Sorry if this is a silly question - I haven't been able to figure it out and I really don't want to have to manually enter the size of every sprite (which would be necessary for things like collision detection).
Beta Was this translation helpful? Give feedback.
All reactions