本文整理汇总了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);
}
示例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
}
示例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);
}