Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add it before onrendergui() in client.cpp
- void DrawRectRainbow(int x, int y, int width, int height, float flSpeed, float &flRainbow)
- {
- ImDrawList* windowDrawList = ImGui::GetWindowDrawList();
- Color colColor(0, 0, 0, 255);
- flRainbow += flSpeed;
- if (flRainbow > 1.f) flRainbow = 0.f;
- for (int i = 0; i < width; i++)
- {
- float hue = (1.f / (float)width) * i;
- hue -= flRainbow;
- if (hue < 0.f) hue += 1.f;
- Color colRainbow = colColor.FromHSB(hue, 1.f, 1.f);
- windowDrawList->AddRectFilled(ImVec2(x + i, y), ImVec2(width, height), colRainbow.GetU32());
- }
- }
- add that in the menu
- static float flRainbow;
- float flSpeed = 0.0003f;
- int curWidth = 1;
- ImVec2 curPos = ImGui::GetCursorPos();
- ImVec2 curWindowPos = ImGui::GetWindowPos();
- curPos.x += curWindowPos.x;
- curPos.y += curWindowPos.y;
- int size;
- int y;
- Interfaces::Engine()->GetScreenSize(y, size);
- DrawRectRainbow(curPos.x - 10, curPos.y - 5, ImGui::GetWindowSize().x + size, curPos.y + -4, flSpeed, flRainbow);
- =====================================================================================================
- fix for GetU32().
- add it in color.hpp
- after
- static Color FromHSB(float hue, float saturation, float brightness)
- ImU32 GetU32()
- {
- return ((_color[3] & 0xff) << 24) + ((_color[2] & 0xff) << 16) + ((_color[1] & 0xff) << 8)
- + (_color[0] & 0xff);
- //return (ImU32)(((_color[3] & 0xff) << 24) + ((_color[0] & 0xff) << 16) + ((_color[1] & 0xff) << 8) + (_color[2] & 0xff));
- }
- How it looks: https://imgur.com/a/qOeHd
- where to put second part of code:
- https://imgur.com/a/WaE7Y
- HOW TO CHANGE THE SIZE OR THE BAR:
- DrawRectRainbow(curPos.x - 10, curPos.y - 5, ImGui::GetWindowSize().x + size, curPos.y + -4, flSpeed, flRainbow);
- -4 is he height change it to your likeing.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement