Example #1
0
        public static void Dispose()
        {
            UIWindow.Dispose();
            UIWindow = null;

            Elements.Clear();

            Shaders.Dispose();
        }
Example #2
0
        public static void InitUI(int width, int height)
        {
            if (Shaders.Init())
            {
                Elements = new Dictionary <string, UIElement>();

                // create the top level screen container
                UIWindow            = new UIContainer(new Point(0, 0), new Point(UI.Width, UI.Height), "TopLevel");
                UIWindow.RelativeTo = Corner.BottomLeft;
                Elements.Add("Screen", UIWindow);

                UIProjectionMatrix = Matrix4.CreateTranslation(new Vector3(-UI.Width / 2, -UI.Height / 2, 0)) * Matrix4.CreateOrthographic(UI.Width, UI.Height, 0, 1000);

                Visible = true;

                MainThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;

                OnResize(width, height);
            }
        }