You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm certain this was not the intention, but as a new user playing with the UI, I had a heck of a time getting an image as a button working. I am very new to Bevy, having only used it since a few days after 0.6 launched. This is the first feedback I've ever attempted to provide with regards to Bevy.
Initially, my tests included making a ButtonBundle with only the image field defined and everything else defaulted. This resulted in an invisible button that didn't respond to any interactions. Next, I tried a ButtonBundle with an ImageBundle child. This resulted in the image appearing, but it did not function as a button, as it wasn't responding to clicked/hover interactions. This was unlike buttons with defaulted fields and a child of TextBundle which seemed to work exactly as I had expected.
After that, I decided to try to set some of the Style settings. Giving the ButtonBundle a Size in its Style was essential for getting an image to work as a button, no children nodes were necessary. Without it, the default settings were not giving me a working button. You can actually get the same results of an invisible image button with Val::Auto in the Size, which I assume is the Default.
My thinking was that Val::Auto/Default should default to the size of the image. It was difficult to troubleshoot, considering I had already defined the size of the parent nodes, it did not occur to me that I should size the button itself. In any case, if this isn't intended reasoning for Val::Auto, then perhaps an example could be made in the Button example with an image as the button to avoid confusion for others. It also seems inconsistent that a button with text on it needs a child, while a button with an image on it doesn't.
Is the way I accomplished it the intended usage, or have I stumbled into a bug?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm certain this was not the intention, but as a new user playing with the UI, I had a heck of a time getting an image as a button working. I am very new to Bevy, having only used it since a few days after 0.6 launched. This is the first feedback I've ever attempted to provide with regards to Bevy.
Initially, my tests included making a ButtonBundle with only the image field defined and everything else defaulted. This resulted in an invisible button that didn't respond to any interactions. Next, I tried a ButtonBundle with an ImageBundle child. This resulted in the image appearing, but it did not function as a button, as it wasn't responding to clicked/hover interactions. This was unlike buttons with defaulted fields and a child of TextBundle which seemed to work exactly as I had expected.
After that, I decided to try to set some of the Style settings. Giving the ButtonBundle a Size in its Style was essential for getting an image to work as a button, no children nodes were necessary. Without it, the default settings were not giving me a working button. You can actually get the same results of an invisible image button with Val::Auto in the Size, which I assume is the Default.
My thinking was that Val::Auto/Default should default to the size of the image. It was difficult to troubleshoot, considering I had already defined the size of the parent nodes, it did not occur to me that I should size the button itself. In any case, if this isn't intended reasoning for Val::Auto, then perhaps an example could be made in the Button example with an image as the button to avoid confusion for others. It also seems inconsistent that a button with text on it needs a child, while a button with an image on it doesn't.
Is the way I accomplished it the intended usage, or have I stumbled into a bug?
Beta Was this translation helpful? Give feedback.
All reactions