[SOLVED] How can I center a lemur component in a SpringGridLayout


#1

What I want to do is center a label inside a column. Usually, the label is placed on the left.


#2

Center its text or center the label itself?

To center the text, set the TextHAlignment.
http://jmonkeyengine-contributions.github.io/Lemur/javadoc/Lemur/com/simsilica/lemur/Label.html#setTextHAlignment(com.simsilica.lemur.HAlignment)

To center the label itself (like if it has a background you want centered), use a DynamicInsetsComponent(0, 0.5f, 0, 0.5f) as its insets component.
http://jmonkeyengine-contributions.github.io/Lemur/javadoc/Lemur/com/simsilica/lemur/Panel.html#setInsetsComponent(com.simsilica.lemur.component.InsetsComponent)