Shavv
Member
Heey!
I made this little code to draw an outline over one object and one only. It works but when i mouse over multiple objects at the same time, none of them get shown.
I use the mask for getting a different collision for the mouse and the movement collision.
I want to make the object with the lowest depth value the one that gets an outline.
Thanks for the help!
I made this little code to draw an outline over one object and one only. It works but when i mouse over multiple objects at the same time, none of them get shown.
Code:
///outline(color,mousemask,normalmask)
mask_index=argument1
if position_meeting(mouse_x,mouse_y,self)
{
if global.mouse_over=id
{
//Set an outline color
var outline_color = argument0;
d3d_set_fog(1,outline_color,-1,-1)
//Draw the sprite 1 pixel off in each direction
draw_sprite_ext(sprite_index, -1, x - 1, y, image_xscale, image_yscale, 0, outline_color, 1);
draw_sprite_ext(sprite_index, -1, x + 1, y, image_xscale, image_yscale, 0, outline_color, 1);
draw_sprite_ext(sprite_index, -1, x, y - 1, image_xscale, image_yscale, 0, outline_color, 1);
draw_sprite_ext(sprite_index, -1, x, y + 1, image_xscale, image_yscale, 0, outline_color, 1);
d3d_set_fog(0,0,0,0)
//set target
if mouse_check_button_pressed(mb_right)
{
obj_player.target=id
}
}
global.mouse_over=id
}
mask_index=argument2
I want to make the object with the lowest depth value the one that gets an outline.
Thanks for the help!