ivan.cuevas Posted August 9, 2018 Share Posted August 9, 2018 Hi all, I'm using Unigine 2.7.1. I've realized button background is not scaled when a custom height is set. This doesn't happen with button width. With the following code... <?xml version="1.0" encoding="utf-8"?> <ui version="1.0"> <vbox name="root_vbx" space_y="8"> <font size="45" face="fonts/opensans-regular.ttf" voffset="4"> <button width="644" height="83"> <text align="center" rich="1">BUTTON <font face="fonts/opensans-light.ttf">1</font></text> </button> <button width="644"> <text align="center" rich="1">BUTTON <font face="fonts/opensans-light.ttf">2</font></text> </button> <button width="644"> <text align="center" rich="1">BUTTON <font face="fonts/opensans-light.ttf">3</font></text> </button> <button width="644"> <text align="center" rich="1">BUTTON <font face="fonts/opensans-light.ttf">4</font></text> </button> </font> </vbox> </ui> I get this visual result: The space is taken into account, but the button image is not resized to fill this space. Regards. Link to comment
andrey-kozlov Posted August 10, 2018 Share Posted August 10, 2018 Hello, WidgetButton doesn't take into account height set by user in rendering and events handling. That seems to be a bug and we'll fix it. For now only way I found to get to button's height (beside font's height) is using texture. Using 1x83 transparent placeholder image through "texture" attribute forces the button to set desired height 1 Link to comment
ivan.cuevas Posted August 13, 2018 Author Share Posted August 13, 2018 Hi Andrey, Thanks for the workaround. Regards. Link to comment
Recommended Posts