T
trentallain
Guest
Hi, I need help converting the shader object's draw GUI event into a normal draw event, due to depth issues and the fact that it would take too long to re-code all the HUD to enable the mouse clicking on it.
Here is the code for the object:
PS: The script is fairly irrelevant in what I need help with and the shader code isn't mine.
Here is the code for the object:
Code:
//Create Event:
//execute code:
draw_set_color(c_white);
display_set_gui_maximise(window_get_width()/340,window_get_width()/340)
uni_resolution_hoz = shader_get_uniform(shd_gaussian_horizontal,"resolution");
uni_resolution_vert = shader_get_uniform(shd_gaussian_vertical,"resolution");
var_resolution_x = view_wview;
var_resolution_y = view_hview;
uni_blur_amount_hoz = shader_get_uniform(shd_gaussian_vertical,"blur_amount");
uni_blur_amount_vert = shader_get_uniform(shd_gaussian_horizontal,"blur_amount");
var_blur_amount = 1.0;
shader_enabled = false;
final_surface = surface_create(view_wview,view_hview);
surf = surface_create(view_wview, view_hview);
view_surface_id[0] = surf;
//Draw GUI Event:
//execute code:
if (shader_is_compiled(shd_gaussian_horizontal))
if (shader_is_compiled(shd_gaussian_vertical))
{
var_mouse_pos_x = mouse_x - view_xview;
var_mouse_pos_y = mouse_y - view_yview;
//Do horizontal blur first
surface_set_target(final_surface);
if shader_enabled shader_set(shd_gaussian_horizontal);
shader_set_uniform_f(uni_resolution_hoz, var_resolution_x, var_resolution_y);
shader_set_uniform_f(uni_blur_amount_hoz, var_blur_amount);
draw_surface(surf,0,0);
shader_reset();
surface_reset_target();
//Do vertical blur last
if shader_enabled shader_set(shd_gaussian_vertical);
shader_set_uniform_f(uni_resolution_vert, var_resolution_x, var_resolution_y);
shader_set_uniform_f(uni_blur_amount_vert, var_blur_amount);
draw_surface(final_surface,0,0);
shader_reset();
}
else show_debug_message("Shader failed");
//Nothing below here ~~~
scr_gamepad_hotbar() //Needs to be drawn above all
if (global.controller_hotbar == true)
{
shader_enabled = true
}
else shader_enabled = false