とても簡単です。実装するだけSystem.Threading
で完了です。
仕組みは次のとおりです。最初に次を追加します。
using System.Threading;
クラスの一番上に、次のものを追加します。
//the enum for state types
enum GameState
{
Loading,
StartMenu
}
//Init our gameState enum as variable
GameState gameState;
protected override void LoadContent()
{
gameState = GameState.Loading;
spriteBatch = new SpriteBatch(GraphicsDevice);
device = GraphicsDevice;
Window.Title = "Your Window";
//Other stuff that you had here before, now go in LoadGame()
loadingscreen = Content.Load<Texture2D>("loading");
Thread bgLoad = new Thread(new ThreadStart(LoadGame));
bgLoad.IsBackground = true;
bgLoad.Start();
}
public void LoadGame()
{
//Loading stuff here
gameState = GameState.StartMenu; //or GameState.Playing
}
次に、コンテンツプロジェクトに読み込みテクスチャを配置します