I have a bunch of buttons, each on uses an image in the imageset that is 100 pixels square. When I create the buttons (through Lua, not that that matters), I wnat the buttons to always be 100 pixels square (no stretching for anything). It seems to me taht it should be possible in this case to not need to call setSize() for each button, and just have them use the size of their image to define the size of the button, but I have no idea how to do this.
Any suggestions?
How can I make a button with a set size
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
For sizing a button to an arbitrary image, the required support is not there at moment; at least not in an ideal way (though I have made a note of an idea related to this).
However, since you know that the button needs to be 100 pixels, you can actually create a 'skin' for the button that defaults to that size. You do this by using a "Property" specifier element in the LookNFeel XML file. So in that button WidgetLook you would just have something like:
This would make all the buttons start life as 100 pixels square.
HTH
CE.
However, since you know that the button needs to be 100 pixels, you can actually create a 'skin' for the button that defaults to that size. You do this by using a "Property" specifier element in the LookNFeel XML file. So in that button WidgetLook you would just have something like:
Code: Select all
<Property name="UnifiedSize" value="{{0,100},{0,100}}" />
This would make all the buttons start life as 100 pixels square.
HTH
CE.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 13 guests