当前位置: 首页>>代码示例>>C#>>正文


C# Vector3.WorldToMinimap方法代码示例

本文整理汇总了C#中System.Vector3.WorldToMinimap方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.WorldToMinimap方法的具体用法?C# Vector3.WorldToMinimap怎么用?C# Vector3.WorldToMinimap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Vector3的用法示例。


在下文中一共展示了Vector3.WorldToMinimap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawWardMinimap

        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);
        }
开发者ID:strcow,项目名称:CowBuddy,代码行数:11,代码来源:Ward.cs

示例2: WorldToMinimap

        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
        }
开发者ID:JumpAttacker,项目名称:EnsageSharp,代码行数:44,代码来源:Helper.cs

示例3: DrawCricleMinimap

        public static void DrawCricleMinimap(Vector3 mapPosition, float radius, Color color,
            float width = 2F,
            int quality = -1)
        {
            DrawCricleMinimap(mapPosition.WorldToMinimap(), radius * MinimapMul, color, width, quality);

        }
开发者ID:qkwlqk,项目名称:EloBuddy,代码行数:7,代码来源:Util.cs


注:本文中的System.Vector3.WorldToMinimap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。