コード例 #1
0
ファイル: Game1.cs プロジェクト: dav3ck/Game
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.White);

            spriteBatch.Begin();
            foreach (var item in SolidTile.LoadedTiles)
            {
                item.Draw();
            }
            spriteBatch.End();

            FrontSpriteBatch.Begin();
            player.Draw();

            foreach (var _npc in NPC.NPClist)
            {
                _npc.Draw();
            }
            foreach (var _object in SolidTile.LoadedObjects)
            {
                _object.Draw();
            }

            if (Textbox.TextBoxes.Any() == true)
            {
                Textbox.Draw();
            }

            //SpriteSheet.screenDraw("Textbox_SpriteSheet", 0, 1, new Vector2(100, 100), FrontSpriteBatch);

            FrontSpriteBatch.End();

            //Console.WriteLine(gameTime.TotalGameTime);
            // TODO: Add your drawing code here

            base.Draw(gameTime);
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: dav3ck/PrologueGame
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            spriteBatch.Begin();
            foreach (var Tile in map1.Tilelist)
            {
                Tile.Draw(Screen.GridSize);
            }
            spriteBatch.End();

            FrontSpriteBatch.Begin();
            player.Draw();
            npc1.Draw();
            TestObject.Draw();
            textbox1.Draw();
            FrontSpriteBatch.End();



            // TODO: Add your drawing code here

            base.Draw(gameTime);
        }