I have a (Scene2d) Table containing a Label, both added to a Stage, and I'm properly calling stage.act(float)
and stage.draw()
. However, if I modify the text of the Label (using setText()
) to be wider than the Table, the Table doesn't automatically widen, which I can tell because it's being rendered with a background. This is surprising to me since the setText(CharSequence)
method calls invalidateHierarchy(), which I'd assume would be sufficient. I suspect if I were to then call pack()
on the Table instance it would be sized correctly, but that seems like a code smell to me. (Calling pack()
on the Label itself appears to do nothing.)
Should I be calling pack()
on the Table anyway? Or should I be recursing up the parent
hierarchy of the Label calling pack()
as I go? Or is there some other sane way of handling this...
Thanks!
expand
orfill
? \$\endgroup\$