public static void Draw(SpriteBatch spriteBatch) { BaseSprite.Draw(spriteBatch); // Draw Bounding Cirles bool drawBoundingCirles = false; if (drawBoundingCirles) { PrimitiveLine brush = new PrimitiveLine(spriteBatch.GraphicsDevice); brush.Colour = Color.Green; brush.CreateCircle(LongRange, 42); brush.Position = BaseSprite.ScreenCenter; brush.Render(spriteBatch); PrimitiveLine encounterRangeBrush = new PrimitiveLine(spriteBatch.GraphicsDevice); encounterRangeBrush.Colour = Color.Green; encounterRangeBrush.CreateCircle(EncounterRange, 42); encounterRangeBrush.Position = BaseSprite.ScreenCenter; encounterRangeBrush.Render(spriteBatch); } }
static public void Draw(SpriteBatch spriteBatch) { List <SpaceTile> onScreen = GetSpaceTilesInView(); PrimitiveLine encounterRangeBrush = new PrimitiveLine(spriteBatch.GraphicsDevice); encounterRangeBrush.Colour = Color.Red; foreach (SpaceTile spaceTile in onScreen) { spaceTile.BaseSprite.Draw(spriteBatch); // Draw Bounding Cirles if (false) { encounterRangeBrush.CreateCircle(spaceTile.EncounterRange, 12); encounterRangeBrush.Position = spaceTile.BaseSprite.ScreenCenter; encounterRangeBrush.Render(spriteBatch); } } //int startX = GetSquareByPixelX((int)Camera.Position.X); //int endX = GetSquareByPixelY((int)Camera.Position.X + Camera.ViewPortWidth); //int startY = GetSquareByPixelY((int)Camera.Position.Y); //int endY = GetSquareByPixelY((int)Camera.Position.Y + Camera.ViewPortHeight); //for (int x = startX; x <= endX; x++) // for (int y = startY; y <= endY; y++) // { // if ((x >= 0) && (y >= 0) && // (x < MapWidth) && (y < MapHeight)) // { // spriteBatch.Draw( // texture, // SquareScreenRectangle(x, y), // tiles[GetTileAtSquare(x, y)], // Color.White); // } // } }
public static void Draw(SpriteBatch spriteBatch) { List<SpaceTile> onScreen = GetSpaceTilesInView(); PrimitiveLine encounterRangeBrush = new PrimitiveLine(spriteBatch.GraphicsDevice); encounterRangeBrush.Colour = Color.Red; foreach( SpaceTile spaceTile in onScreen) { spaceTile.BaseSprite.Draw(spriteBatch); // Draw Bounding Cirles if (false) { encounterRangeBrush.CreateCircle(spaceTile.EncounterRange, 12); encounterRangeBrush.Position = spaceTile.BaseSprite.ScreenCenter; encounterRangeBrush.Render(spriteBatch); } } //int startX = GetSquareByPixelX((int)Camera.Position.X); //int endX = GetSquareByPixelY((int)Camera.Position.X + Camera.ViewPortWidth); //int startY = GetSquareByPixelY((int)Camera.Position.Y); //int endY = GetSquareByPixelY((int)Camera.Position.Y + Camera.ViewPortHeight); //for (int x = startX; x <= endX; x++) // for (int y = startY; y <= endY; y++) // { // if ((x >= 0) && (y >= 0) && // (x < MapWidth) && (y < MapHeight)) // { // spriteBatch.Draw( // texture, // SquareScreenRectangle(x, y), // tiles[GetTileAtSquare(x, y)], // Color.White); // } // } }