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

Вопрос Molotov timing help

  • Автор темы Автор темы BestChen
  • Дата начала Дата начала
Начинающий
Начинающий
Статус
Оффлайн
Регистрация
22 Окт 2019
Сообщения
32
Реакции
19
how to implement the Molotov timing method like NL style?

like this

q1HGc.gif


I checked this post and the method used in the post is to draw lines.
It's not circle.

are there any examples of similar timing methods? Please?.
 
Последнее редактирование:
1622748389240.png

this?
Код:
Expand Collapse Copy
if (!g_cfg.esp.molotov_timer)
        return;

    auto inferno = reinterpret_cast<inferno_t*>(entity);
    auto origininf = inferno->GetAbsOrigin();
    Vector screen_origin_m;

    if (!math::world_to_screen(origininf, screen_origin_m))
        return;

    auto spawn_time = inferno->get_spawn_time();
    auto factor = (spawn_time + inferno_t::get_expiry_time() - m_globals()->m_curtime) / inferno_t::get_expiry_time();
    static auto size_m = Vector2D(35.0f, 5.0f);

    render::get().circle_filled(screen_origin_m.x, screen_origin_m.y - size_m.y * 0.5f, 60, 20, Color(15, 15, 15, 187));
    render::get().CircularProgressBar(screen_origin_m.x, screen_origin_m.y - size_m.y * 0.5f, 17, 20, 0, 360 * factor, Color(255, 255, 255, 187), true);
    render::get().text(fonts[ESP], screen_origin_m.x, screen_origin_m.y - size_m.y * 0.5f, g_cfg.esp.molotov_timer_color, HFONT_CENTERED_X | HFONT_CENTERED_Y, "FIRE");
 
Тебе нужен таймер с round progress bar?
yep
Посмотреть вложение 152562
this?
Код:
Expand Collapse Copy
if (!g_cfg.esp.molotov_timer)
        return;

    auto inferno = reinterpret_cast<inferno_t*>(entity);
    auto origininf = inferno->GetAbsOrigin();
    Vector screen_origin_m;

    if (!math::world_to_screen(origininf, screen_origin_m))
        return;

    auto spawn_time = inferno->get_spawn_time();
    auto factor = (spawn_time + inferno_t::get_expiry_time() - m_globals()->m_curtime) / inferno_t::get_expiry_time();
    static auto size_m = Vector2D(35.0f, 5.0f);

    render::get().circle_filled(screen_origin_m.x, screen_origin_m.y - size_m.y * 0.5f, 60, 20, Color(15, 15, 15, 187));
    render::get().CircularProgressBar(screen_origin_m.x, screen_origin_m.y - size_m.y * 0.5f, 17, 20, 0, 360 * factor, Color(255, 255, 255, 187), true);
    render::get().text(fonts[ESP], screen_origin_m.x, screen_origin_m.y - size_m.y * 0.5f, g_cfg.esp.molotov_timer_color, HFONT_CENTERED_X | HFONT_CENTERED_Y, "FIRE");
draw lines, not circle.
 
Посмотреть вложение 152562
this?
Код:
Expand Collapse Copy
if (!g_cfg.esp.molotov_timer)
        return;

    auto inferno = reinterpret_cast<inferno_t*>(entity);
    auto origininf = inferno->GetAbsOrigin();
    Vector screen_origin_m;

    if (!math::world_to_screen(origininf, screen_origin_m))
        return;

    auto spawn_time = inferno->get_spawn_time();
    auto factor = (spawn_time + inferno_t::get_expiry_time() - m_globals()->m_curtime) / inferno_t::get_expiry_time();
    static auto size_m = Vector2D(35.0f, 5.0f);

    render::get().circle_filled(screen_origin_m.x, screen_origin_m.y - size_m.y * 0.5f, 60, 20, Color(15, 15, 15, 187));
    render::get().CircularProgressBar(screen_origin_m.x, screen_origin_m.y - size_m.y * 0.5f, 17, 20, 0, 360 * factor, Color(255, 255, 255, 187), true);
    render::get().text(fonts[ESP], screen_origin_m.x, screen_origin_m.y - size_m.y * 0.5f, g_cfg.esp.molotov_timer_color, HFONT_CENTERED_X | HFONT_CENTERED_Y, "FIRE");
можно ещё иконку для красоты добавить в рендер
 
I asked some people and the answer was to use sin/cos.
Or draw lines.
u just could use for render circle progress bar this:
C++:
Expand Collapse Copy
void render::CircularProgressBar (int x, int y, int r1, int r2, int s, int d, Color col, bool inverse)
{
    for (int i = s; i <s + d; i ++)
    {
        auto rad = i * M_PI / 180;
        if (!inverse)
            line (x + cos (rad) * r1, y + sin (rad) * r1, x + cos (rad) * r2, y + sin (rad) * r2, col);
        else
            line (x - sin (rad) * r1, y - cos (rad) * r1, x - sin (rad) * r2, y - cos (rad) * r2, col);
    }
}
code for example:
C++:
Expand Collapse Copy
 static float rotate = 0.f;
        if (rotate <= 1.f)
            rotate += 0.01f;
        else
            rotate = 0.0;
        CircularProgressBar (100, 100, 10, 15, 90, 360 * rotate, ImColor(255, 255, 255));
showcase
Пожалуйста, авторизуйтесь для просмотра ссылки.

credits: INСАНЯ
 
I asked some people and the answer was to use sin/cos.
Or draw lines.
вот тебе отрисовка линии, подгоняй под свой сдк.
C++:
Expand Collapse Copy
void render_manager::line(int x, int y, int x2, int y2, Color color, int thickline)
{
    if (!m_Surface())
        return;

    color.SetAlpha(static_cast<int>(color.a() * alpha_factor));

    if (thickline) {
        Vertex_t vertices[6];
        vertices[0].Init(vec2(x, y));
        vertices[1].Init(vec2(x2, y2));
        vertices[2].Init(vec2(x, y + thickline));
        vertices[3].Init(vec2(x2, y2 + thickline));
        vertices[4].Init(vec2(x, y - thickline));
        vertices[5].Init(vec2(x2, y2 - thickline));

        m_Surface()->DrawSetColor(color);
        m_Surface()->DrawTexturedPolyLine(vertices, sizeof vertices / sizeof Vertex_t);
    }
    else {
        m_Surface()->DrawSetColor(color);
        m_Surface()->DrawLine(x, y, x2, y2);
    }
}
 
вот тебе отрисовка линии, подгоняй под свой сдк.
C++:
Expand Collapse Copy
void render_manager::line(int x, int y, int x2, int y2, Color color, int thickline)
{
    if (!m_Surface())
        return;

    color.SetAlpha(static_cast<int>(color.a() * alpha_factor));

    if (thickline) {
        Vertex_t vertices[6];
        vertices[0].Init(vec2(x, y));
        vertices[1].Init(vec2(x2, y2));
        vertices[2].Init(vec2(x, y + thickline));
        vertices[3].Init(vec2(x2, y2 + thickline));
        vertices[4].Init(vec2(x, y - thickline));
        vertices[5].Init(vec2(x2, y2 - thickline));

        m_Surface()->DrawSetColor(color);
        m_Surface()->DrawTexturedPolyLine(vertices, sizeof vertices / sizeof Vertex_t);
    }
    else {
        m_Surface()->DrawSetColor(color);
        m_Surface()->DrawLine(x, y, x2, y2);
    }
}
он скорее всего лв пастит, в лв есть отрисовка линии
 
Назад
Сверху Снизу