本文整理汇总了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);
}
示例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 );
}
示例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);
}
示例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);
}