NiftyGui panel fit content in height

Hello, I have some text in my panel And I would like the panel to fit the text in Height only. so the result would be a panel that grows in height with the text.

is it possible to make with stardard tags? Or do I have to use custom effects?


I vaguely remember Nifty having a sizeToContent method or some such thing. I guess you could use that after capturing the current width and then just reapply the width? I don’t use Nifty, so I’m not really sure how accurate my memory is on the subject. But hey! Maybe it won’t be a total waist of your time!!

Eh… nm… that wouldn’t work anyways >.<

If you don’t set the height property of a parent panel then Nifty will determine the height from the child elements. Try this:



This works for any child content and it works for the width too.

1 Like

Oh nice didn’t see your asnwers! :slight_smile:

my solution was to set the width and height of the text and the panel in a custom control :confused:

i’ll try your solution void as soon as i’m home,
BTW thanks alot for developping Nifty I fkin <3u