Esempio n. 1
0
        private static void DrawWardMinimap(Vector3 center, Color color)
        {
            var centerMap = center.WorldToMinimap();
            var a = new Vector2(centerMap.X - 5, centerMap.Y);
            var b = new Vector2(centerMap.X + 5, centerMap.Y);
            var c = new Vector2(centerMap.X, centerMap.Y + 10);

            Drawing.DrawLine(a, b, 2f, color);
            Drawing.DrawLine(b, c, 2f, color);
            Drawing.DrawLine(c, a, 2f, color);
        }
Esempio n. 2
0
        public static Vector2 WorldToMinimap(Vector3 pos)
        {
            return pos.WorldToMinimap();

            #region OldShit

            var x = pos.X - MapLeft;
            var y = pos.Y - MapBottom;

            float dx, dy, px, py;
            if (Math.Round((float) Drawing.Width/Drawing.Height, 1) >= 1.7)
            {
                dx = 272f/1920f*Drawing.Width;
                dy = 261f/1080f*Drawing.Height;
                px = 11f/1920f*Drawing.Width;
                py = 11f/1080f*Drawing.Height;
            }
            else if (Math.Round((float) Drawing.Width/Drawing.Height, 1) >= 1.5)
            {
                dx = 267f/1680f*Drawing.Width;
                dy = 252f/1050f*Drawing.Height;
                px = 10f/1680f*Drawing.Width;
                py = 11f/1050f*Drawing.Height;
            }
            else
            {
                dx = 255f/1280f*Drawing.Width;
                dy = 229f/1024f*Drawing.Height;
                px = 6f/1280f*Drawing.Width;
                py = 9f/1024f*Drawing.Height;
            }
            var minimapMapScaleX = dx/MapWidth;
            var minimapMapScaleY = dy/MapHeight;

            var scaledX = Math.Min(Math.Max(x*minimapMapScaleX, 0), dx);
            var scaledY = Math.Min(Math.Max(y*minimapMapScaleY, 0), dy);

            var screenX = px + scaledX;
            var screenY = Drawing.Height - scaledY - py;

            return new Vector2((float) Math.Floor(screenX), (float) Math.Floor(screenY));

            #endregion
        }
Esempio n. 3
0
        public static void DrawCricleMinimap(Vector3 mapPosition, float radius, Color color,
            float width = 2F,
            int quality = -1)
        {
            DrawCricleMinimap(mapPosition.WorldToMinimap(), radius * MinimapMul, color, width, quality);

        }