本文整理汇总了C#中GameScreen.SetupLocalServer方法的典型用法代码示例。如果您正苦于以下问题:C# GameScreen.SetupLocalServer方法的具体用法?C# GameScreen.SetupLocalServer怎么用?C# GameScreen.SetupLocalServer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameScreen
的用法示例。
在下文中一共展示了GameScreen.SetupLocalServer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public override void Initialize(GraphicsDevice Device, ScreenManager manager)
{
base.Initialize(Device, manager);
Settings.LoadSettings();
Panel panel = new Panel(this, new Vector2(300, 160), new Vector2(200, 280), Content.ContentInterface.LoadTexture("UITest"));
Button button = new Button(this, new Vector2(60, 30), new Vector2(80, 40), Content.ContentInterface.LoadTexture("UITest"),
delegate { Settings.ServerAddress = "localhost";
_manager.RemoveScreen(this); GameScreen screen = new GameScreen();
screen.SetupLocalServer(); _manager.AddScreen(screen); },
"Local");
AddChild(panel);
panel.AddChild(button);
button = new Button(this, new Vector2(20, 90), new Vector2(160, 40), Content.ContentInterface.LoadTexture("UITest"),
delegate { _manager.RemoveScreen(this); _manager.AddScreen(new GameScreen()); },
"Online");
panel.AddChild(button);
button = new Button(this, new Vector2(20, 150), new Vector2(160, 40), Content.ContentInterface.LoadTexture("UITest"),
delegate { Console.WriteLine("Test2"); },
"Testbutton2");
panel.AddChild(button);
button = new Button(this, new Vector2(20, 210), new Vector2(160, 40), Content.ContentInterface.LoadTexture("UITest"),
delegate { Console.WriteLine("Test3"); },
"Testbutton3");
panel.AddChild(button);
}