A responsive dynamic crosshair widget for GTA V:
void DrawDynamicCrosshair(Vector2 screenCenter, float spreadRadius, ImU32 color) {
ImDrawList* dl = ImGui::GetBackgroundDrawList();
float gap = max(4.0f, spreadRadius * 20.0f); // Expands as spread increases
float len = 8.0f;
// Top, Bottom, Left, Right crosshair lines
dl->AddLine(ImVec2(screenCenter.x, screenCenter.y - gap), ImVec2(screenCenter.x, screenCenter.y - gap - len), color, 2.0f);
dl->AddLine(ImVec2(screenCenter.x, screenCenter.y + gap), ImVec2(screenCenter.x, screenCenter.y + gap + len), color, 2.0f);
dl->AddLine(ImVec2(screenCenter.x - gap, screenCenter.y), ImVec2(screenCenter.x - gap - len, screenCenter.y), color, 2.0f);
dl->AddLine(ImVec2(screenCenter.x + gap, screenCenter.y), ImVec2(screenCenter.x + gap + len, screenCenter.y), color, 2.0f);
}