Исходник Crosshair / external / internal

Начинающий
Статус
Оффлайн
Регистрация
21 Мар 2021
Сообщения
171
Реакции[?]
16
Поинты[?]
2K
2023-04-02_03-02-17.pngподойдет вообще для всех игр это просто рендер
код -
Код:
 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);
 
Сверху Снизу