Подведи собственные итоги года совместно с YOUGAME и забери ценные призы! Перейти

Вопрос Как сделать такую вещь в ксгосимпл

  • Автор темы Автор темы michaekl
  • Дата начала Дата начала
Забаненный
Забаненный
Статус
Оффлайн
Регистрация
10 Ноя 2020
Сообщения
79
Реакции
7
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
вот такую вещь вроде типо дравкей
1625525850829.png
 
it's a simple draw_text function

1. check if you're pressing the key
2. draw_text "-" if you're not pressing the key and draw_text "W" if not
3. call it in paint traverse hook
4. DONE
as an example:
Код:
Expand Collapse Copy
void Visuals::DrawKeyPresses() {
    int w, h;
    g_EngineClient->GetScreenSize(w, h);
    if (GetAsyncKeyState(int('W')))
        Render::Get().RenderText("W", ImVec2(w / 2, h - h / 5), 40.f, Color(255, 255, 255, 255), true);
    else
        Render::Get().RenderText("_", ImVec2(w / 2, h - h / 5), 40.f, Color(255, 255, 255, 255), true);

    if (GetAsyncKeyState(int('S')))
        Render::Get().RenderText("S", ImVec2(w / 2, h - h / 5 + 50), 40.f, Color(255, 255, 255, 255), true);
    else
        Render::Get().RenderText("_", ImVec2(w / 2, h - h / 5 + 50), 40.f, Color(255, 255, 255, 255), true);

    if (GetAsyncKeyState(int('A')))
        Render::Get().RenderText("A", ImVec2(w / 2 - 50, h - h / 5), 40.f, Color(255, 255, 255, 255), true);
    else
        Render::Get().RenderText("_", ImVec2(w / 2 - 50, h - h / 5), 40.f, Color(255, 255, 255, 255), true);

    if (GetAsyncKeyState(int('D')))
        Render::Get().RenderText("D", ImVec2(w / 2 + 50, h - h / 5), 40.f, Color(255, 255, 255, 255), true);
    else
        Render::Get().RenderText("_", ImVec2(w / 2 + 50, h - h / 5), 40.f, Color(255, 255, 255, 255), true);
}

you can also make it 1 line like this:
Код:
Expand Collapse Copy
char* text;
    GetAsyncKeyState(int('W')) ? text = "W" : text = "_";
    Render::Get().RenderText(text, ImVec2(w / 2, h - h / 5), 40.f, Color(255, 255, 255, 255), true);
 
Последнее редактирование:
you can also make it 1 line like this:
Код:
Expand Collapse Copy
char* text;
    GetAsyncKeyState(int('W')) ? text = "W" : text = "_";
    Render::Get().RenderText(text, ImVec2(w / 2, h - h / 5), 40.f, Color(255, 255, 255, 255), true);

C++:
Expand Collapse Copy
Render::Get().RenderText(GetAsyncKeyState(0x57) ?  "W" : "_", ImVec2(w / 2, h - h / 5), 40.f, Color(255, 255, 255, 255), true);

lol, for what u need useless stuff
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Назад
Сверху Снизу