Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upImages on buttons #171
Comments
bvssvni
added
the
discussion
label
Nov 19, 2014
This comment has been minimized.
This comment has been minimized.
|
In Windows Forms (.NET) you could set both image and text and choose how to align the text. |
This comment has been minimized.
This comment has been minimized.
|
Alternative is to create a separate button type for images. |
This comment has been minimized.
This comment has been minimized.
|
Yes this would be awesome :) |
This comment has been minimized.
This comment has been minimized.
|
On Android, There's an It might be the same functionality that @bvssvni said about Windows Forms, but I think it's very nice, since an icon with a label is pretty common usecase for a GUI. |
This comment has been minimized.
This comment has been minimized.
|
On iOS, there is a method to set 'backgroundImage' – very convenient for buttons with custom design. |
This comment has been minimized.
This comment has been minimized.
|
In my opinion, Label could have different subtypes like: TextLabel, ImageLabel or CompositeLabel(Image+Text), because it's easier to code, using @gaudecker example:
|
This comment has been minimized.
This comment has been minimized.
xilec
commented
May 8, 2015
|
In my opinion, it would be awesome realize something like WPF Content Model. I understand that it is too complicated solutions for topic task. But I saw attempts to realize Layouts in conrod and it would be greate using layouts to evade implementation of controls by hand which is just a combination of some basic controls (like Label, Button and Image for topic case). |
mitchmindtree
modified the milestone:
1.0.0
Jul 11, 2015
This comment has been minimized.
This comment has been minimized.
|
Just thought I'd mention that #696 adds a primitive |
This comment has been minimized.
This comment has been minimized.
|
I have been trying to tackle some rudimentary implementation of this feature: I don't understand why if I cover a part of the button with an image, though that part seems not to be clickable anymore. It is obvious when running the all_widgets example from my pull request and clicking the button that has a texture. Does this behaviour make sense to anyone following this? Any tip? |
This comment has been minimized.
This comment has been minimized.
|
For a quick update: I figured out what was missing. The image widget was capturing the mouse events that should have been captured by the button widget. I know have the basic functionality working: a button with a texture. It doesn't handle positioning of the image within the button with respect to a label, though but it gives a starting point. I also removed the part that modifies the button in the all_widgets example and wrote a dedicated button example to showcase the feature (heavily inspired from all_widgets). This included modifying the git history, so I closed pull request #783 and opened #785. I would welcome feedback, be it code review or suggestions for tackling more complex workflows (Like CompositeButton described in earlier comment) |
pierrechevalier83
added a commit
that referenced
this issue
Aug 15, 2016
This comment has been minimized.
This comment has been minimized.
|
Merged pull request for simple fix (add image method that takes image index) |

bvssvni commentedNov 19, 2014
See reddit comment http://www.reddit.com/r/rust_gamedev/comments/2mlvxa/can_conrod_buttons_have_images/