Sometimes we need to construct a whole panel before adding to GUI which includes RadioButton or other child widgets.
But no text is shown in that case.
I think the order independent scene construction is prefered by everyone.
I used TGUI.Net in .Net4.0(C#) / VS2010 / Windows7.
(quick hack made me happy )
And I found TGUI is very good library.
Thank you very much!
But no text is shown in that case.
I think the order independent scene construction is prefered by everyone.
I used TGUI.Net in .Net4.0(C#) / VS2010 / Windows7.
Code Select
static public void LoadWidgets (Gui gui) {
// Create the background image
var pic = gui.Add (new Picture ("media/Vanity.jpg"));
pic.Size = new Vector2f (800, 600);
var panel = new Panel ();
panel.Position = new Vector2f (200, 100);
panel.Size = new Vector2f (400, 400);
panel.BackgroundColor = Color.White;
// Before
var btn1 = panel.Add (new RadioButton ("widgets/Black.conf"));
btn1.Text = "Hello, world 1";
btn1.TextColor = Color.Black;
//
gui.Add (panel);
// After
var btn2 = panel.Add (new RadioButton ("widgets/Black.conf"));
btn2.Text = "Hello, world 2";
btn2.TextColor = Color.Black;
btn2.Position = new Vector2f (0, 50);
// quick hack.
//btn1.TextFont = btn1.Parent.GlobalFont;
//btn1.TextSize = 0;
}
(quick hack made me happy )
And I found TGUI is very good library.
Thank you very much!