Esempio n. 1
0
        protected void SetupGui()
        {
            guiRenderer = new Renderer(window, RenderQueueGroupID.Overlay, false);
            // set the scene manager
            guiRenderer.SetSceneManager(scene);

            // init the subsystem singleton
            new GuiSystem(guiRenderer);

            // configure the default mouse cursor
            GuiSystem.Instance.DefaultCursor = null;
            GuiSystem.Instance.CurrentCursor = null;

            // max window size, based on the size of the Axiom window
            SizeF maxSize = new SizeF(window.Width, window.Height);

            rootWindow = new Window("Window/RootWindow");
            // rootWindow.MetricsMode = MetricsMode.Absolute;
            rootWindow.MaximumSize = maxSize;
            rootWindow.Size = maxSize;
            rootWindow.Visible = true;

            // set the main window as the primary GUI sheet
            GuiSystem.Instance.SetRootWindow(rootWindow);

            // Load the default imageset
            try
            {
                AtlasManager.Instance.CreateAtlas(MultiverseImagesetFile);
            }
            catch (AxiomException e)
            {
                throw new PrettyClientException("bad_media.htm", "Invalid media repository", e);
            }

            xmlUiWindow = new Window("XmlUiWindow");
            // xmlUiWindow.MetricsMode = MetricsMode.Absolute;
            xmlUiWindow.MaximumSize = rootWindow.MaximumSize;
            xmlUiWindow.Size = rootWindow.Size;
            xmlUiWindow.Visible = false;

            rootWindow.AddChild(xmlUiWindow);

            // Set up the gui elements
            SetupGuiElements();

            FontManager.SetupFonts();

            rootWindow.Activate();
            xmlUiWindow.Activate();
        }