Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Dionysius on August 16, 2008, 08:48:44 PM
-
Is there any solution to calculate height of StaticControl.Text or to fit height of StaticControl to its Text?
-
There sure is. I will give you the caption window example since it uses text. Try this:
var win = Game.LoadWindow("interface\system\caption.window"); // Stores the window in the win variable.
global WinCaption = win.GetWidget("caption");// stores the win entity/widget "caption" in the global varible.
WinCaption.SizeToFit();// The important part. This resizes the control to fit the text size.
Remember this is an example. Don't copy and paste it because you will stuff up your caption window.
Cheers ::beer
Myles Blasonato.
-
Thank you!
-
No worries,
Write back and tell me if it worked.
Cheers ::beer
Myles Blasonato.
-
StaticControl.HeightToFit() works good for me :) I must was found it in documentation earlier. :)
-
No worries, glad to have helped.
Cheers ::beer
Myles Blasonato.