Skip to content

Instantly share code, notes, and snippets.

@PoppyWorks
Last active Jul 23, 2018
Embed
What would you like to do?
GML script. Will fade the screen to the chosen color. Returns true when done. This can be used to change rooms when it returns. Line 6 can be un-commented to do the fade to color in steps, to simulate old-school style color fading.
///draw_fade_color(color,speed/alplha)
alert(0,"Fading..." + "(" + (string(color_fade_alpha)) +"). Cannot pause game." )
can_pause = false;
depth = -100000
var snapped = color_fade_alpha//= floor(color_fade_alpha * 10)/10
draw_set_colour(argument0)
draw_set_alpha(snapped);
draw_rectangle(0, 0, view_xview [0] + view_wview[0], view_yview[0] + view_hview[0], false);
draw_set_blend_mode_ext(bm_src_colour,bm_zero);
color_fade_alpha += argument1;
draw_set_blend_mode(bm_normal);
draw_set_alpha(1);
if color_fade_alpha >= 1
{
color_fade_alpha = 0
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment