cartToIso method

Vector2 cartToIso(
  1. Vector2 p
)

Converts a coordinate from the cartesian space to the isometric space.

Implementation

Vector2 cartToIso(Vector2 p) {
  final x = p.x - p.y;
  final y = ((p.x + p.y) * scalingFactor) / 2;
  return Vector2(x, y);
}