Beispiel #1
0
        public static Vec2 MapToWidget(this IMiniMap miniMap, Vec2 p)
        {
            var config = BattleMiniMapConfig.Get();
            var scale  = (float)config.WidgetWidth / miniMap.BitmapWidth;

            return(new Vec2((p.X * scale), (p.Y * scale)));
        }
Beispiel #2
0
        public static Vec2 WidgetToMap(this IMiniMap miniMap, Vec2 p)
        {
            var config = BattleMiniMapConfig.Get();
            var scale  = (float)config.WidgetWidth / miniMap.BitmapWidth;

            return(new Vec2(p.X / scale, p.Y / scale));
        }
Beispiel #3
0
        public static float MapFToWidget(this IMiniMap miniMap, float f)
        {
            var config = BattleMiniMapConfig.Get();
            var scale  = (float)config.WidgetWidth / miniMap.BitmapWidth;

            return(f * scale);
        }
Beispiel #4
0
 public static Vec2 MapFToWorld(this IMiniMap miniMap, Vec2 point)
 {
     return(new Vec2(MapFToWorld(point.y, miniMap.Resolution, miniMap.MapBoundMin.x),
                     MapFToWorld(point.x, miniMap.Resolution, miniMap.MapBoundMin.y)));
 }
Beispiel #5
0
 public static Vec2 MapToWorld(this IMiniMap miniMap, Point point)
 {
     return(new Vec2(MapToWorld(point.Y, miniMap.Resolution, miniMap.MapBoundMin.x),
                     MapToWorld(point.X, miniMap.Resolution, miniMap.MapBoundMin.y)));
 }
Beispiel #6
0
 public static Vec2 WorldToMapF(this IMiniMap miniMap, Vec2 position)
 {
     return(new Vec2(WorldToMapF(position.y, miniMap.Resolution, miniMap.MapBoundMin.y),
                     WorldToMapF(position.x, miniMap.Resolution, miniMap.MapBoundMin.x)));
 }
Beispiel #7
0
 public static Point WorldToMap(this IMiniMap miniMap, Vec2 position)
 {
     return(new Point(WorldToMap(position.y, miniMap.Resolution, miniMap.MapBoundMin.y),
                      WorldToMap(position.x, miniMap.Resolution, miniMap.MapBoundMin.x)));
 }