Replies: 1 comment
-
I think I know how to do that. just use parent spawner's world access to get the resources I need. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I’m trying to implement a close button UI in my Bevy project using
impl Bundle
. The button’s image node needs aHandle<Image>
, which I load as an asset and store as a resource. However, this means I have to pass the handle as a parameter all the way up to where the button is used by user, which exposes unnecessary details in my API.Is there a recommended way in Bevy to keep the API clean—using
impl Bundle
—but inject the image handle (loaded by the bevy asset loader) “implicitly” or via a system, instead of passing it through every function? For example, is there a common pattern for this, or any best practices for setting up UI bundles that require asset handles without leaking them through public interfaces?Any advice or examples would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions