/// <summary> /// Gets the scaled dimensions of a given width and height as if projectected onto the mini-map. /// </summary> /// <param name="width"></param> /// <param name="height"></param> /// <returns></returns> public static Vector2 GetSizeOnMinimap(float width, float height) //Main.mapStyle == 1 { float baseX = Main.screenPosition.X; float baseY = Main.screenPosition.Y; Vector2 mapBasePos = HUDMapHelpers.GetMiniMapScreenPosition(new Rectangle((int)baseX, (int)baseY, 0, 0)).Item1; Vector2 mapNewPos = HUDMapHelpers.GetMiniMapScreenPosition(new Rectangle((int)(baseX + width), (int)(baseY + height), 0, 0)).Item1; return(mapNewPos - mapBasePos); }
/// <summary> /// Returns a screen position of a given world position as if projected onto the overlay map. /// </summary> /// <param name="worldPosition"></param> /// <returns>A tuple indicating the screen-relative position and whether the point is within the screen /// boundaries.</returns> public static Tuple <Vector2, bool> GetOverlayMapScreenPosition(Vector2 worldPosition) //Main.mapStyle == 2 { return(HUDMapHelpers.GetOverlayMapScreenPosition(new Rectangle((int)worldPosition.X, (int)worldPosition.Y, 0, 0))); }
/// <summary> /// Returns a screen position of a given world position as if projected onto the fullscreen map. /// </summary> /// <param name="worldPosition"></param> /// <returns>A tuple indicating the screen-relative position and whether the point is within the screen /// boundaries.</returns> public static Tuple <Vector2, bool> GetFullMapScreenPosition(Vector2 worldPosition) //Main.mapFullscreen { return(HUDMapHelpers.GetFullMapScreenPosition(new Rectangle((int)worldPosition.X, (int)worldPosition.Y, 0, 0))); }