Code: Select all
overlay = OverlayManager.Singleton.Create("MainGUI");
PanelOverlayElement element = (PanelOverlayElement)OverlayManager.Singleton.CreateOverlayElement("Panel", "PanelElement");
element.MaterialName = "Test/ColourTest";
element.Top = 0f;
element.Height = 0.5f;
element.Left = 0f;
element.Width = 1f;
element.Colour = new ColourValue(0, 1, 1, 1);
TextAreaOverlayElement text = (TextAreaOverlayElement)OverlayManager.Singleton.CreateOverlayElement("TextArea", "TestText");
text.Colour = new ColourValue(0, 0, 1, 1);
text.CharHeight = 16;
FontPtr mFont = FontManager.Singleton.Create("BlueHighway", "General");
mFont.Type = FontType.FT_TRUETYPE;
mFont.TrueTypeSize = 16;
mFont.TrueTypeResolution = 96;
mFont.AddCodePointRange(new Pair<uint, uint>(33, 255));
mFont.Source = "bluehigh.ttf";
text.FontName = "BlueHighway";
text.Left = 0.1f;
text.Top = 0.1f;
text.Width = 0.5f;
text.Height = 0.5f;
text.SetAlignment(TextAreaOverlayElement.Alignment.Left);
text.Caption = "Hello World";
text.Show();
element.AddChild(text);
element.Show();
overlay.Add2D(element);
overlay.Show();
Code: Select all
MaterialPtr material = MaterialManager.Singleton.Create("Test/ColourTest", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME);
In theory, it should render a cyan wall covering half the screen with deep-blue text on it.
Why is this not working?
I'm thinking it's because the material ignores the Colour value set on the elements and forces everything to white - how do I avoid that?