本文整理汇总了C#中Microsoft.Xna.Framework.Game.Run方法的典型用法代码示例。如果您正苦于以下问题:C# Game.Run方法的具体用法?C# Game.Run怎么用?C# Game.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Xna.Framework.Game
的用法示例。
在下文中一共展示了Game.Run方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
using (var game = new Game())
{
game.Run();
}
}
示例2: Main
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
MathHelper.Clamp(4, 3, 5);
using (Game game = new Game())
{
game.Run();
}
}
示例3: changeState
public static void changeState(state s)
{
currentState = s;
game.Exit();
//game = null; //abandon old game
switch (currentState)
{
case state.Level:
Thread.Sleep(1000);
game = new Game1();
game.Run();
break;
}
}
示例4: SetUp
public void SetUp()
{
game = new Game();
graphics = new GraphicsDeviceManager(game);
graphics.GraphicsProfile = GraphicsProfile.HiDef;
contentManager = new ContentManager(game.Services);
contentManager.RootDirectory = @"C:\Content\";
game.Run();
spriteBatch = new SpriteBatch(game.GraphicsDevice);
game.Services.AddService(typeof(SpriteBatch), spriteBatch);
catalogManager = new CatalogManager();
game.Services.AddService(typeof(CatalogManager), catalogManager);
}
示例5: SetUp
public void SetUp()
{
game = new Game();
_replayId = string.Empty;
graphics = new GraphicsDeviceManager(game);
graphics.GraphicsProfile = GraphicsProfile.HiDef;
contentManager = new ContentManager(game.Services);
contentManager.RootDirectory = @"C:\Content\";
game.Run();
spriteBatch = new SpriteBatch(game.GraphicsDevice);
game.Services.AddService(typeof(SpriteBatch), spriteBatch);
catalogManager = new CatalogManager();
catalogManager.AddExerciseToSelected("fakeExercise", "fake");
game.Services.AddService(typeof(CatalogManager), catalogManager);
}
示例6: SetUp
public void SetUp()
{
_game = new Game();
_graphicsDeviceManager = new GraphicsDeviceManager(_game) { GraphicsProfile = GraphicsProfile.HiDef };
_contentManager = new ContentManager(_game.Services)
{
RootDirectory = @"C:\Content"
};
_game.Run();
_spriteBatch = new SpriteBatch(_game.GraphicsDevice);
_game.Services.AddService(typeof(SpriteBatch), _spriteBatch);
string[] files = Directory.GetFiles(@"c:\school");
foreach (string file in files)
{
File.Delete(file);
}
}
示例7: RunTest
private void RunTest(InteractiveTest test) {
if (_activeGame != null || _activeTest != null)
throw new InvalidOperationException("An interactive test is already active.");
_activeTest = test;
_activeGame = test.Create ();
_activeGame.Exiting += ActiveGame_Exiting;
_activeGame.Run (GameRunBehavior.Asynchronous);
View.Window.Hidden = true;
}
示例8: Run
public static void Run(params GameScreen[] screens)
{
Game = new Game();
Game.Components.Add(new EngineHelper());
Contents = new ContentManager();
Graphics = new GraphicsDeviceManager(Game);
Inputs = new InputManager();
Screens = new ScreenManager();
Settings = new SettingsManager();
Graphics.PreferredBackBufferWidth = Settings.Get<int>("Graphics.Window.Width");
Graphics.PreferredBackBufferHeight = Settings.Get<int>("Graphics.Window.Height");
Graphics.IsFullScreen = Settings.Get<bool>("Graphics.Window.Fullscreen");
foreach (GameScreen screen in screens)
Screens.Add(screen);
Game.Run();
}
示例9: Begin
public static void Begin()
{
currentState = state.Intro;
game = new Intro();
game.Run();
}
示例10: FinishedLaunching
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override void FinishedLaunching(UIApplication application)
{
game = new Game1();
game.Run();
}