-
Автор темы
- #1
подойдет вообще для всех игр это просто рендер
код -
код -
Код:
const ImVec2 screenSize = ImGui::GetIO().DisplaySize;
const ImVec2 screenCenter = screenSize * 0.5f;
const float crosshairSize = 10.f;
const float crosshairThickness = 1.f;
const float crosshairGap = 2.f; // расстояние посередине
const ImU32 crosshairColor = IM_COL32(0, 255, 0, 255);
pBackgroundDrawList->AddLine(
ImVec2(screenCenter.x - crosshairSize - crosshairGap,
screenCenter.y),
ImVec2(screenCenter.x - crosshairGap, screenCenter.y),
crosshairColor, crosshairThickness);
pBackgroundDrawList->AddLine(
ImVec2(screenCenter.x + crosshairGap, screenCenter.y),
ImVec2(screenCenter.x + crosshairSize + crosshairGap,
screenCenter.y),
crosshairColor, crosshairThickness);
pBackgroundDrawList->AddLine(
ImVec2(screenCenter.x,
screenCenter.y - crosshairSize - crosshairGap),
ImVec2(screenCenter.x, screenCenter.y - crosshairGap),
crosshairColor, crosshairThickness);
pBackgroundDrawList->AddLine(
ImVec2(screenCenter.x, screenCenter.y + crosshairGap),
ImVec2(screenCenter.x,
screenCenter.y + crosshairSize + crosshairGap),
crosshairColor, crosshairThickness);