R
r3unite
Guest
I have an issue with an HTML export, however this works flawlessly in a Windows compile.
Problem: background change isn't detected in draw event.
My draw event contains this piece of code:
The shader is working, it draws the background correctly, except it doesn't react to the lightSwitch variable which is toggled if the user presses on the lightswitch.
Here is the part of code in my Glob Left Pressed event that detects clicks on the lightswitch:
The snd_lightswitch sound plays, everything adds up to this point except NO CHANGE IN BACKGROUND.
I've tried making ridicoulus changes to that draw event piece of code, and nothing seems to work...
I'm devistated since literally everything else works flawlessly except this unexplained bug?!
You can try it yourself on this link, if it means anything: http://r3unite.freesite.vip/
Any help is much appreciated!
Problem: background change isn't detected in draw event.
My draw event contains this piece of code:
GML:
if surface_exists(surf_action)
{
surface_set_target(surf_action);
// view_surface_id[0] = surf_action; 2622
if lightState == false
{
draw_background(bg_fnaf2,wpX,0)
}
if lightState == true
{
draw_background(bg_fnaf1,wpX,0)
}
// draw_background(currentWallpaper,wpX,0)
texture_set_interpolation(false);
if grannyDefense > -1
{
draw_sprite(spr_addition_grannyWindow,0,wpX,0)
}
if windowState{
draw_sprite(spr_closedwindow,lightState,wpX + windowX,windowY)
}
texture_set_interpolation(true);
surface_reset_target();
shader_set(shader_motionblur)
shader_set_uniform_f(upos,motionBlurRight*5 + motionBlurLeft*5,2)
shader_set(shd_test);
draw_surface(surf_action,0,0);
shader_reset();
draw_set_color(c_white)
draw_set_font(font_fnad)
draw_sprite_ext(spr_oxygeneBar,round((oxygeneLevel/100)),5,5,1,1,0,c_white,0.7)
draw_set_alpha(0.7)
draw_text(640- string_width("M MM "), 5, realTime)
//draw_set_font(-1)
draw_set_alpha(1)
if noiser > -1
{
draw_sprite(spr_noise,noiser,0,0)
}
if intro > -1
{
draw_sprite(spr_intro,night,0,0)
intro--
}
if outro > -1
{
draw_sprite(spr_outro,50-outro,0,0)
outro--
}
if instance_exists(obj_jumpscare_scheduler) && obj_jumpscare_scheduler.active
{
draw_sprite(obj_jumpscare_scheduler.jumpSprite,obj_jumpscare_scheduler.subimg,0,0)
}
}
else
{
surf_action = surface_create(640,480);
surface_set_target(surf_action);
draw_clear_alpha(c_black, 0);
surface_reset_target();
}
//draw_text(10,70, grannyDefense);
/*
draw_set_color(c_red)
draw_text(10,10, gocoLevel); draw_text(50,10, gocoTimer);
draw_text(10,20, adryLevel); draw_text(50,20, adryTimer);
draw_text(10,30, angyLevel); draw_text(50,30, angyTimer);
draw_text(10,40, defenseTimer); draw_text(50,30, angyTimer);
draw_text(10,50, grannyTimer);
draw_text(10,60, grannyPosition);
draw_set_color(c_white)
//draw_text(10,30, wpX)
*/
The shader is working, it draws the background correctly, except it doesn't react to the lightSwitch variable which is toggled if the user presses on the lightswitch.
Here is the part of code in my Glob Left Pressed event that detects clicks on the lightswitch:
GML:
if mouse_xx > 909 && mouse_xx <959 && mouse_yy > 35 && mouse_yy < 93
{
if !audio_is_playing(snd_lightswitch)
{
audio_play_sound_on(obj_test.mainEmitter,snd_lightswitch, false , 1);
}
lightstate = !lightstate
}
I've tried making ridicoulus changes to that draw event piece of code, and nothing seems to work...
I'm devistated since literally everything else works flawlessly except this unexplained bug?!
You can try it yourself on this link, if it means anything: http://r3unite.freesite.vip/
Any help is much appreciated!