コード例 #1
0
ファイル: MapIconsRenderer.cs プロジェクト: benjy3gg/PoeHud
        private void RenderIconsOnMiniMap(RenderingContext rc, Element smallMinimap)
        {
            Vec2 playerPos = model.Player.GetComponent<Positioned>().GridPos;
            float pPosZ = model.Player.GetComponent<Render>().Z;

            const float scale = 240f;
            Rect clientRect = smallMinimap.GetClientRect();
            Vec2 minimapCenter = new Vec2(clientRect.X + clientRect.W/2, clientRect.Y + clientRect.H/2);
            double diag = Math.Sqrt(clientRect.W*clientRect.W + clientRect.H*clientRect.H)/2.0;
            foreach (MapIcon icon in _getIcons())
            {
                if (ShouldSkipIcon(icon))
                    continue;

                float iZ = icon.Entity.GetComponent<Render>().Z;
                Vec2 point = minimapCenter + MapIcon.deltaInWorldToMinimapDelta(icon.WorldPosition - playerPos, diag, scale, (int) ((iZ - pPosZ)/20));

                var texture = icon.MinimapIcon;
                int size = icon.Size;
                Rect rect = new Rect(point.X - size/2, point.Y - size/2, size, size);
                texture.DrawAt(rc, point, rect);
            }
        }
コード例 #2
0
ファイル: Imports.cs プロジェクト: sbradno/PoeHud
 public static extern bool GetWindowRect(IntPtr hwnd, out Rect lpRect);
コード例 #3
0
ファイル: MapIconsRenderer.cs プロジェクト: benjy3gg/PoeHud
        private void RednerIconsOnLargeMap(RenderingContext rc)
        {
            var camera = model.Internal.Game.IngameState.Camera;
            var cw = camera.Width;
            var ch = camera.Height;
            BigMinimap mapWindow = model.Internal.Game.IngameState.IngameUi.Minimap;
            Rect rcMap = mapWindow.GetClientRect();

            Vec2 playerPos = model.Player.GetComponent<Positioned>().GridPos;
            float pPosZ = model.Player.GetComponent<Render>().Z;
            Vec2 screenCenter = new Vec2(rcMap.W / 2, rcMap.H / 2) + new Vec2(rcMap.X, rcMap.Y) + new Vec2((int)mapWindow.ShiftX, (int)mapWindow.ShiftY);
            float diag = (float)Math.Sqrt(cw * cw + ch * ch);

            // const float scale = 1280f;
            var k = cw < 1024 ? 1120 : 1024;
            float scale = (float)k / ch * cw * 3 / 4;

            foreach (MapIcon icon in _getIcons())
            {
                if (ShouldSkipIcon(icon))
                    continue;

                float iZ = icon.Entity.GetComponent<Render>().Z;
                Vec2 point = screenCenter + MapIcon.deltaInWorldToMinimapDelta(icon.WorldPosition - playerPos, diag, scale, (int)((iZ - pPosZ) / 10));

                var texture = icon.LargeMapIcon ?? icon.MinimapIcon;
                int size = icon.SizeOfLargeIcon.GetValueOrDefault(icon.Size * 2);
                Rect rect = new Rect(point.X - size / 2, point.Y - size / 2, size, size);
                texture.DrawAt(rc, point, rect);
            }
        }
コード例 #4
0
ファイル: Imports.cs プロジェクト: sbradno/PoeHud
 public static extern bool GetClientRect(IntPtr hWnd, out Rect lpRect);