Static helper for UI layout coordinates used by the map. Defines a 1080p reference half-size, a clip inset, and methods to convert map-space X/Y and camera offsets into local UI coordinates.
namespace BlockParty;
/// <summary>Map-space geometry and the shared camera offset, in 1080-reference pixels.</summary>
internal static class MapUiLayout
{
public const float HalfSize = 540f;
// Matches .clip's left/top inset and .map-content's compensating offset.
public const float ClipInset = 9f;
public static float LocalX( float mapX ) => HalfSize + mapX;
public static float LocalY( float mapY ) => HalfSize - mapY;
public static float CameraLeft( float cameraX ) => -ClipInset - cameraX;
public static float CameraTop( float cameraY ) => -ClipInset + cameraY;
}