"centerleft" doesnt work for a Button with auto width, workaround?

What i try to achive is a line underneath a Text with the exact length of the Text. As this seems not possible by default, my idea was to use a button with "auto" width, which holds the same Text as the label. to scale the texture to the exact text length. (which works.)

Now the Problem: I can easely center the text, but struggle to center the Button underneath, (which holds the Texture). my idea was to use <centerleft>50%</centerleft> to position the Button (But this seems to work only with a integer width).

Does may someone have a Idea how to solve this? Dont have to be the "Button aproach", just Looking for a solution to have a Text underlined with the exact label length.

Try putting the button inside a horizontal grouplist with <align>center</align>


<control type="grouplist">
<control type="button">

I'm not 100% sure if it works but from memory I think it might.
Thanks, works!

would (have) be cool if there would be something which work inside of a list, would have reduce the efford! (thers nothing a could think of)
I knew, just use a button inside a list is (already) "evil".

Currently not shure if the effect is worth it to fiddle around thurder with animations to make it look good, so i may leave it "as is".

Thanks for the "Grouplist hint"!

Thread Rating:
  • 0 Vote(s) - 0 Average

Logout Mark Read Team Forum Stats Members Help
"centerleft" doesnt work for a Button with auto width, workaround?00