当前位置: 首页>>代码示例>>C#>>正文


C# UIManager.Add方法代码示例

本文整理汇总了C#中UIManager.Add方法的典型用法代码示例。如果您正苦于以下问题:C# UIManager.Add方法的具体用法?C# UIManager.Add怎么用?C# UIManager.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIManager的用法示例。


在下文中一共展示了UIManager.Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadContent

        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);
        }
开发者ID:adamxi,项目名称:SharpDXFramework,代码行数:26,代码来源:MainTestScene.cs

示例2: Menu

        public Menu()
        {
            //UIManager.DrawDebug = true;
            uiManager = new UIManager();
            uiManager.EnableProfilling = true;

            UITweenPanel menuPanel = new UITweenPanel();
            menuPanel.Alpha = 0f;
            menuPanel.AddConstraint( Edge.CenterXY, null, Edge.CenterXY );
            menuPanel.AddChild( GetMenuEntry( menuPanel, "New Game" ) );
            menuPanel.AddChild( GetMenuEntry( menuPanel, "Continue" ) );
            menuPanel.AddChild( GetMenuEntry( menuPanel, "Options" ) );
            menuPanel.AddChild( GetMenuEntry( menuPanel, "Help" ) );
            menuPanel.AddChild( GetMenuEntry( menuPanel, "Exit" ) );

            uiManager.Add( menuPanel );
        }
开发者ID:adamxi,项目名称:SharpDXFramework,代码行数:17,代码来源:Menu.cs

示例3: UIControl

 /// <summary>
 /// Initializes a new UIControl class.
 /// </summary>
 /// <param name="assignedUIManager">The assigned UIManager.</param>
 protected UIControl(UIManager assignedUIManager)
 {
     _position = new Vector2(0, 0);
     _size = new UISize(0, 0);
     UpdateBounds();
     _mouseRectangle = new Rectangle {Width = 1, Height = 1};
     Guid = Guid.NewGuid();
     _inputManager = SGL.Components.Get<InputManager>();
     CanGetFocus = true;
     Enable = true;
     Visible = true;
     _parent = null;
     _lastRelativeMousePostion = new Vector2(0, 0);
     Children = new List<UIControl>();
     UIManager = assignedUIManager;
     UIManager.Add(this);
 }
开发者ID:ThuCommix,项目名称:Sharpex2D,代码行数:21,代码来源:UIControl.cs

示例4: LoadContent

        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);
        }
开发者ID:adamxi,项目名称:SharpDXFramework,代码行数:24,代码来源:TestScene.cs


注:本文中的UIManager.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。