Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

less of a [BUG] but more of a [HELP] #67

Open
CPlusPlusNewb opened this issue Dec 25, 2019 · 1 comment
Open

less of a [BUG] but more of a [HELP] #67

CPlusPlusNewb opened this issue Dec 25, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@CPlusPlusNewb
Copy link

CPlusPlusNewb commented Dec 25, 2019

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.

@CPlusPlusNewb CPlusPlusNewb added the bug Something isn't working label Dec 25, 2019
@txxmo
Copy link
Contributor

txxmo commented Dec 28, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants