public void DrawMiniLights(SpriteBatch spriteBatch, MiniMap map) { for (int i = 0; i < this.units.Count(); i++) { Unit unit = this.units.ElementAt(i); Point miniMapPoint = map.MapToMiniMap(unit.GetLocation()); spriteBatch.Draw( lightTexture, new Vector2( miniMapPoint.X - 1, miniMapPoint.Y - 1), null, Color.White, 0f, new Vector2(16, 16), (int)(unit.visionRange / lightTexture.Width / (2.1)), SpriteEffects.None, 1.0f); } for (int i = 0; i < this.buildings.Count(); i++) { Building b = this.buildings.ElementAt(i); if (b.state != Building.State.Preview) { Point miniMapPoint = map.MapToMiniMap(b.GetLocation()); spriteBatch.Draw( lightTexture, new Vector2(miniMapPoint.X, miniMapPoint.Y), null, Color.White, 0f, new Vector2(16, 16), (int)(b.visionRange / lightTexture.Width / (2.1)), SpriteEffects.None, 1.0f); } } }
/// <summary> /// When the minimap reports that it has loaded a small bit. /// </summary> /// <param name="map">The map that's rendering</param> private void OnMiniMapRenderTick(MiniMap map) { Game1.GetInstance().currentLoadProgress += 3; }