/// <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); #region These aren't the droids you are looking for. spriteBatch.Begin(); // Draw the map layer we are walking on. m_TestLayer.Draw(spriteBatch, new Vector2(0, 0)); // Draw the water layer. m_WaterLayer.Draw(spriteBatch, new Vector2(0, 0)); // Draw the goblin lumberjack. //m_Goblin.Draw(spriteBatch); for (int i = 0; i < m_GoblinList.Count; i++) { m_GoblinList[i].Draw(spriteBatch); } // Draw all the trees we have. for (int i = 0; i < m_TreeList.Count; i++) { m_TreeList[i].Draw(spriteBatch); } // Draw the lumber mill. for (int i = 0; i < m_LumberMills.Count; i++) { m_LumberMills[i].Draw(spriteBatch); } // Draw the gobling squad. spriteBatch.End(); spriteBatch.Begin(); // Draw Border. spriteBatch.Draw(m_BorderTexture, m_BorderPosition, Color.White); // Draw Workshop Info // Print current formation information. //spriteBatch.DrawString(m_testFont, "Change Formation (F5): " + m_FormationList[m_currFormationIndex].GetFromationName(), new Vector2(20, 450), Color.White); //spriteBatch.DrawString(m_testFont, "Solid Tiles (F6): " + (m_bSetTilesToSolid ? "ON" : "OFF"), new Vector2(20, 470), Color.White); #endregion #region These aren't the droids you are looking for. //spriteBatch.DrawString(m_testFont, "Logs Carried: " + ((GoblinLumberjack)m_Goblin).GetCarriedWood() + " / " + ((GoblinLumberjack)m_Goblin).GetLogMaxCapacity(), new Vector2(20, 500), Color.White); //spriteBatch.DrawString(m_testFont, "Tree Wood Left: " + ((GoblinLumberjack)m_Goblin).GetTargetTreeWoodLeft(), new Vector2(20, 520), Color.White); // Draw the mouse spriteBatch.Draw(m_mouseTexture, m_mousePostion, m_mouseSource, Color.White); spriteBatch.End(); #endregion base.Draw(gameTime); }
/// <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.CornflowerBlue); spriteBatch.Begin(); _mapLayer.Draw(spriteBatch); /* * if (simulator.GetPowerGridMapBuffer() != null) * { * * //2. Draw Additional Map - Top Right Corner - 4px per point * int miniMapX = graphics.PreferredBackBufferWidth - (WORLD_WIDTH * 2); * int miniMapY = 0; * * for (int x = miniMapX; x < miniMapX + (WORLD_WIDTH * 2); x = x + 2) * { * for (int y = miniMapY; y < (WORLD_HEIGHT * 2); y = y + 2) * { * int actualX = (x - miniMapX) / 2; * int actualY = y / 2; * * int value = simulator.PowerGridMap.WorldGet(actualX, actualY); * * spriteBatch.Draw(rect2x2, new Vector2(x, y), value > 0 ? Color.Red : Color.Black); * } * } * } */ spriteBatch.End(); base.Draw(gameTime); }