コード例 #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            fontFactory = new FontFactory(GraphicsDevice);

            //Load fonts
            SmartFont[] fonts = new SmartFont[100];
            fonts[16] = fontFactory.LoadFont("Consolas", 16f).Load();
            //fonts[32] = fontFactory.LoadFont("Consolas", 32f).Load();
            //fonts[72] = fontFactory.LoadFont("LemonMilk", 72f).Load();

            TextureLib textures = new TextureLib(Content);

            //Load textures
            textures.LoadTexture("board");
            textures.LoadTexture("boardBevel");
            textures.LoadTexture("marbleTable");

            textures.LoadTexture("title");
            textures.LoadTexture("play");
            textures.LoadTexture("singleplayer");
            textures.LoadTexture("singleplayerBig");
            textures.LoadTexture("multiplayer");
            textures.LoadTexture("howtoplay");
            textures.LoadTexture("options");
            textures.LoadTexture("about");
            textures.LoadTexture("goback");
            textures.LoadTexture("gamesetup");
            textures.LoadTexture("human");
            textures.LoadTexture("computer");

            textures.LoadTexture("indentBlue");
            textures.LoadTexture("indentBrown");
            textures.LoadTexture("indentGreen");
            textures.LoadTexture("indentRed");
            textures.LoadTexture("indentYellow");

            textures.LoadTexture("blueMarble");
            textures.LoadTexture("greenMarble");
            textures.LoadTexture("redMarble");
            textures.LoadTexture("yellowMarble");

            content = new GameContent(textures, fonts);

            MainMenu mainMenu = new MainMenu(this);

            gameStates.Add("mainmenu", mainMenu);

            Singleplayer singleplayer = new Singleplayer(this);

            gameStates.Add("singleplayer", singleplayer);

            Gameplay gameplay = new Gameplay(this);

            gameStates.Add("gameplay", gameplay);

            mainMenu.Load(content);
            singleplayer.Load(content);
            gameplay.Load(content);

            currentGameState = mainMenu;
        }