public static void DrawCricleMinimap(Vector2 screenPosition, float radius, Color color, float width = 2F, int quality = -1) { if (quality == -1) { quality = (int) (radius / 3 + 15); } var rad = new Vector2(0, radius); var segments = new List<MinimapCircleSegment>(); var full = true; for (var i = 0; i <= quality; i++) { var pos = (screenPosition + rad).RotateAroundPoint(screenPosition, PI2 * i / quality); var contains = MinimapRectangle.Contains(pos); if (!contains) { full = false; } segments.Add(new MinimapCircleSegment(pos, contains)); } foreach (var ar in FindArcs(segments, full)) { Line.DrawLine(color, width, ar); } }
public void RenderBoard(SpriteBatch sprite) { if (mapInfo == null) { return; } int xShift = centerPoint.X - hScroll; int yShift = centerPoint.Y - vScroll; SelectionInfo sel = GetUserSelectionInfo(); // Render the object lists foreach (IMapleList list in boardItems.AllItemLists) { RenderList(list, sprite, xShift, yShift, sel); } // Render the user's selection square if (mouse.MultiSelectOngoing) { Rectangle selectionRect = InputHandler.CreateRectangle( new Point(MultiBoard.VirtualToPhysical(mouse.MultiSelectStart.X, centerPoint.X, hScroll, 0), MultiBoard.VirtualToPhysical(mouse.MultiSelectStart.Y, centerPoint.Y, vScroll, 0)), new Point(MultiBoard.VirtualToPhysical(mouse.X, centerPoint.X, hScroll, 0), MultiBoard.VirtualToPhysical(mouse.Y, centerPoint.Y, vScroll, 0))); parent.DrawRectangle(sprite, selectionRect, UserSettings.SelectSquare); selectionRect.X++; selectionRect.Y++; selectionRect.Width--; selectionRect.Height--; parent.FillRectangle(sprite, selectionRect, UserSettings.SelectSquareFill); } // Render VR if it exists if (VRRectangle != null && (sel.visibleTypes & VRRectangle.Type) != 0) { VRRectangle.Draw(sprite, xShift, yShift, sel); } // Render minimap rectangle if (MinimapRectangle != null && (sel.visibleTypes & MinimapRectangle.Type) != 0) { MinimapRectangle.Draw(sprite, xShift, yShift, sel); } // Render the minimap itself if (miniMap != null && UserSettings.useMiniMap) { // Area for the image itself Rectangle minimapImageArea = new Rectangle((miniMapPos.X + centerPoint.X) / _mag, (miniMapPos.Y + centerPoint.Y) / _mag, miniMap.Width, miniMap.Height); // Render gray area parent.FillRectangle(sprite, minimapArea, Color.Gray); // Render minimap if (miniMapTexture == null) { miniMapTexture = miniMap.ToTexture2D(parent.GraphicsDevice); } sprite.Draw(miniMapTexture, minimapImageArea, null, Color.White, 0, new Vector2(0, 0), SpriteEffects.None, 0.99999f); // Render current location on minimap parent.DrawRectangle(sprite, new Rectangle(hScroll / _mag, vScroll / _mag, parent.CurrentDXWindowSize.Width / _mag, (int)parent.CurrentDXWindowSize.Height / _mag), Color.Blue); // Render minimap borders parent.DrawRectangle(sprite, minimapImageArea, Color.Black); } // Render center point if InfoMode on if (ApplicationSettings.InfoMode) { parent.FillRectangle(sprite, new Rectangle(MultiBoard.VirtualToPhysical(-5, centerPoint.X, hScroll, 0), MultiBoard.VirtualToPhysical(-5, centerPoint.Y, vScroll, 0), 10, 10), Color.DarkRed); } }