zgui
zgui copied to clipboard
less of a [BUG] but more of a [HELP]
i'm trying to add some gradients from xy0, but when i'm trying to make them into "context.window.render" functions rater then "render::" (so i can draw over stuff), i don't get the output i'm looking for...
not wanted output, but draws over stuff: https://i.imgur.com/HNbvpKz.png
void GradientH(float x, float y, float w, float h, color c1, color c2)
{
context.window.render.emplace_back(zgui::zgui_control_render_t{ {x, y}, zgui::zgui_render_type::zgui_filled_rect, c1, "", {w, h} });
BYTE first = c2.r;
BYTE second = c2.g;
BYTE third = c2.b;
for (float i = 0; i < w; i++)
{
float fi = i, fw = w;
float a = fi / fw;
/*DWORD*/float ia = a * 255;
context.window.render.emplace_back(zgui::zgui_control_render_t{ {x + i, y}, zgui::zgui_render_type::zgui_filled_rect, color(first, second, third, ia), "", {1, h} });
}
}
wanted output, but not drawing over stuff: https://i.imgur.com/NCdyjgD.png
void GradientH(float x, float y, float w, float h, color c1, color c2)
{
render::filled_rect(x, y, w, h, c1);
BYTE first = c2.r;
BYTE second = c2.g;
BYTE third = c2.b;
for (float i = 0; i < w; i++)
{
float fi = i, fw = w;
float a = fi / fw;
/*DWORD*/float ia = a * 255;
render::filled_rect(x + i, y, 1, h, color(first, second, third, ia));
}
}
any help is greatly appreciated, ive looked over this about 10 times, and cant seem to understand why it doesn't work.
ZGUI legacy is no longer in development. So you probably won’t get many answers. What would suggest is: Not pasting Take a good look at where you’re using the code.