コード例 #1
0
ファイル: Game.cs プロジェクト: kjchiu/zomgame-2
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            Logger.Log("Loading Content");
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new ZSpriteBatch(GraphicsDevice);

            GraphicsDispenser.LoadTextureData(Content);
            GraphicsDispenser.LoadFontData(Content);

            MessageLog.Font = GraphicsDispenser.GetFont("MessageBarFont");
            LoadData();
            StateFactory.Init(this);
            this.AddState(StateFactory.CreatePlayState(camera));
        }
コード例 #2
0
ファイル: Game.cs プロジェクト: kjchiu/zomgame-2
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new ZSpriteBatch(GraphicsDevice);

            DirectoryInfo di = new DirectoryInfo(Content.RootDirectory);

            foreach (FileInfo fi in di.GetFiles("*_bmp.xnb"))
            {
                GraphicsDispenser.addTexture(fi.Name.Remove(fi.Name.Length - 4), Content.Load <Texture2D>(Content.RootDirectory + "/" + fi.Name.Remove(fi.Name.Length - 4)));
            }

            font = Content.Load <SpriteFont>("Courier New");
            GraphicsDispenser.AddFont("Courier New", font);
            GraphicsDispenser.AddFont("Default", font);
            MessageLog.Font = font;
            LoadData();
            StateFactory.Init(this);
            this.AddState(StateFactory.CreatePlayState(camera));
        }