dwardu
14-03-2011 16:46:12
I am having a little problem to show some text using the overlay, i am writing the code below and the hello world text doesnt show in my scene unless i resize the window after it started.
what can be the problem?
I also have a problem when creating overlay scripts for ogre, i defined the folder in my resources.cfg, but when i come to using
the program throws an exception saying its not found even though i placed the file directory my resources.cfg file points to.
what can be the problem for these two?
Thanks
var overlay = OverlayManager.Singleton.Create("Test");
var panel = (PanelOverlayElement)OverlayManager.Singleton.CreateOverlayElement("Panel", "TestPanel");
panel.MaterialName = "Core/StatsBlockCenter";
panel.MetricsMode = GuiMetricsMode.GMM_PIXELS;
panel.Top = mRenderWindow.Height - 200;
panel.Left = 200;
panel.Height = 200;
panel.Width = 250;
var text = (TextAreaOverlayElement)OverlayManager.Singleton.CreateOverlayElement("TextArea", "TestTextArea");
text.Caption = "hello world";
text.Top = 75;
text.Left = 75;
text.FontName = "BlueHighway";
text.Colour = ColourValue.White;
text.MetricsMode = GuiMetricsMode.GMM_PIXELS;
text.CharHeight = 16;
text.SetAlignment(TextAreaOverlayElement.Alignment.Center);
text.SetDimensions(250, 200);
panel.AddChildImpl(text);
overlay.Add2D(panel);
text.Show();
panel.Show();
what can be the problem?
I also have a problem when creating overlay scripts for ogre, i defined the folder in my resources.cfg, but when i come to using
OverlayManager.Singleton.GetByName("MyScriptName")
the program throws an exception saying its not found even though i placed the file directory my resources.cfg file points to.
what can be the problem for these two?
Thanks