/////////////////
/// scripts ////
///////////////
// glow_prepare(sprite, subimg, color)
surface_free(obj_control.glow_surface);
var w, h;
w = sprite_get_width(argument0);
h = sprite_get_height(argument0);
obj_control.glow_surface = surface_create(w/2, h/2);
surface_set_target(obj_control.glow_surface);
draw_clear_alpha(0, 0);
texture_set_interpolation(1);
draw_set_blend_mode(bm_add);
repeat 15
begin
draw_sprite_stretched_ext(argument0, argument1, 0, 0, w/2, h/2, argument2, 1);
end;
draw_set_blend_mode(bm_normal);
texture_set_interpolation(0);
surface_reset_target();[/code]
// Glow_draw(sprite, subimg, x, y, alpha);
draw_set_color(c_white);
var i, a, o;
i = -1;
repeat 11
begin
i += 1;
a = lengthdir_x(argument4, 270+180*(i/9));
o = (i-6)*4 + 24;
draw_surface_ext(obj_control.glow_surface, argument2+o-18, argument3, 2, 2, 0, c_white, a);
draw_surface_ext(obj_control.glow_surface, argument2, argument3+o-18, 2, 2, 0, c_white, a);
end;
draw_sprite(argument0, argument1, argument2, argument3);[/code]
////////////////////
///// objects //////
////////////////////
/// obj_control ///
//create event (!)
glow_surface = surface_create(4, 4); // Dummy surface
glow_sine = 0; // Sine variable for the pulse effect
glow_id = -1; // ID that keeps the current glowing object[/code]
// draw event (!)
if glow_id != -1 // If a glowing object is selected
{
glow_sine += 0.075; // Make sure the sine is moving
alpha = 0.1 + (sin(glow_sine)+1)/2 * 0.15; // Calculate alpha
glow_draw(glow_id.sprite_index, 0, glow_id.x, glow_id.y, alpha);
}[/code]
[code]
Create event for objects that will be selectable
color = c_red; // Define glow color for this object[/code]
/// obj_43_txt ///
// create event
color = c_red; // Define glow color for this object
// Mouse enter event
/// Glow Effect
glow_prepare(sprite_index, 0, color);// Prepare glow surface
obj_control.glow_id = id;// Set the controller variable to this ID
/// mouse leave event
obj_control.glow_id = -1; // Reset ID variable