Last active
July 29, 2016 01:43
-
-
Save deckerego/5fa3bdcca7e080cd621b56f951125959 to your computer and use it in GitHub Desktop.
Shine a spotlight over a scene in GameMaker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.fadeIn += fadeStep; | |
if(fadeIn < fadeMax) { | |
alarm[0] = fadeSpeed; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.fadeSpeed = room_speed / 15; | |
self.fadeIn = 0; | |
self.fadeStep = 10; | |
self.fadeMax = 140; | |
self.spot_surface = surface_create(room_width, room_height); // Will be erased if video memory reclaimed | |
self.alarm[0] = self.fadeSpeed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
draw_surface_ext(self.spot_surface, 0, 0, 1, 1, 0, c_white, 0.9); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
surface_set_target(self.spot_surface); | |
draw_rectangle_color(0, 0, room_width, room_height, c_black, c_black, c_black, c_black, false); | |
draw_set_blend_mode(bm_subtract); | |
draw_circle_color(self.x, self.y, (room_width / 2) - self.fadeIn, c_white, c_white, false); | |
draw_set_blend_mode(bm_normal); | |
surface_reset_target(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment