Ejemplo n.º 1
0
        public override void LoadContent()
        {
            var menuBar = new UIPanel();

            menuBar.AddConstraint(Edge.Top, null, Edge.Top, 10);
            menuBar.AddConstraint(Edge.Left, null, Edge.Left, 50);
            menuBar.Alpha = 0f;

            var homeItem = new UIButton();

            homeItem.AddDecoration(new UILabel("Home Menu"));
            homeItem.AddConstraint(Edge.Left, menuBar, Edge.Left);
            homeItem.AddConstraint(Edge.CenterY, menuBar, Edge.CenterY);
            homeItem.InputReleased += HomeItem_InputReleased;
            menuBar.AddChild(homeItem);

            var debugCheckbox = new UILabelCheckBox("Draw UI Borders:");

            debugCheckbox.AddConstraint(Edge.Left, homeItem, Edge.Right, -20);
            debugCheckbox.AddConstraint(Edge.CenterY, menuBar, Edge.CenterY);
            debugCheckbox.CheckBox.InputReleased += DebugCheckbox_InputReleased;
            debugCheckbox.CheckBox.Checked        = UIManager.DrawDebug;
            menuBar.AddChild(debugCheckbox);

            testSceneUIManager = new UIManager();
            testSceneUIManager.Add(menuBar);
        }
Ejemplo n.º 2
0
        public override void LoadContent()
        {
            base.LoadContent();

            cam       = new Camera(GraphicsDevice);
            uiManager = new UIManager();
            //uiManager.EnableProfilling = true;

            var menuPanel = new UIPanel();

            menuPanel.AddConstraint(Edge.CenterXY, null, Edge.CenterXY);
            menuPanel.Alpha = 0f;

            var testScenesButton = GetMenuEntry(menuPanel, "UI Test Scenes");

            testScenesButton.InputReleased += testScenes;
            menuPanel.AddChild(testScenesButton);

            var transitionScenesButton = GetMenuEntry(menuPanel, "Transition Test Scenes");

            transitionScenesButton.InputReleased += TransitionScenesButton_InputReleased;
            menuPanel.AddChild(transitionScenesButton);

            var exitButton = GetMenuEntry(menuPanel, "Exit");

            exitButton.InputReleased += ExitButton_InputReleased;
            menuPanel.AddChild(exitButton);

            uiManager.Add(menuPanel);
        }