Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if !surface_exists(surf){
- surf=surface_create(room_width,room_height);
- surface_set_target(surf);
- draw_clear_alpha(c_black,0);
- with objBlock
- {
- var color = other.color
- var thickness = other.thickness
- var a;
- for (a = 0; a < image_xscale; a += 0.5)
- {
- if not (position_meeting(x + a * 32, y - 1, objBlock) or position_meeting(x + (a + 0.5) * 32 - 1, y - 1, objBlock)) // above
- {
- draw_rectangle_color(x + a * 32,y,x+(a + 0.5) * 32 - 1,y+thickness,color,color,color,color,false);
- }
- if not (position_meeting(x + a * 32, y +32 * image_yscale, objBlock) or position_meeting(x + (a + 0.5) * 32 - 1, y + 32 * image_yscale, objBlock)) // below
- {
- draw_rectangle_color(x + a * 32,y + 32 * image_yscale - 1 - thickness,x+(a + 0.5) * 32 - 1,y+32 * image_yscale - 1,color,color,color,color,false);
- }
- }
- for (a = 0; a < image_yscale; a += 0.5)
- {
- if not (position_meeting(x -1, y + a * 32, objBlock) or position_meeting(x -1, y + (a + 0.5) * 32 - 1, objBlock)) // left
- {
- draw_rectangle_color(x ,y + a * 32,x+thickness,y+(a + 0.5) * 32 - 1,color,color,color,color,false);
- }
- if not (position_meeting(x +32 * image_xscale, y + a * 32, objBlock) or position_meeting(x + 32 * image_xscale, y + (a + 0.5) * 32 - 1, objBlock)) // right
- {
- draw_rectangle_color(x + 32 * image_xscale - 1 - thickness,y + a * 32,x+ 32 * image_xscale - 1,y+(a + 0.5) * 32 - 1,color,color,color,color,false);
- }
- }
- }
- with objBlock
- {
- var thickness = other.thickness
- var color = other.color
- var a = 0;
- for (a = 0; a < image_xscale; a += 0.5)
- {
- if not (position_meeting(x + a * 32, y - 1, objBlock) or position_meeting(x + (a + 0.5) * 32 - 1, y - 1, objBlock)) // above
- {
- if (position_meeting(x+a*32-2,y-2,objBlock) and position_meeting(x+a*32-2,y+2,objBlock))
- {
- draw_rectangle_color(x+a*32-thickness-1,y,x+a*32-1,y+thickness,color,color,color,color,0);
- }
- if (position_meeting(x+(a+.5)*32+1,y-1,objBlock) and position_meeting(x+(a+.5)*32+1,y+1,objBlock))
- draw_rectangle_color(x+(a+.5)*32,y,x+(a+.5)*32+thickness,y+thickness,color,color,color,color,0);
- }
- if not (position_meeting(x + a * 32, y +32 * image_yscale, objBlock) or position_meeting(x + (a + 0.5) * 32 - 1, y + 32 * image_yscale, objBlock)) // below
- {
- if (position_meeting(x+a*32-1,y+1+sprite_height,objBlock) and position_meeting(x+a*32-1,y+sprite_height-1,objBlock))
- draw_rectangle_color(x+a*32-thickness-1,y+sprite_height-thickness-1,x+a*32-1,y+sprite_height,color,color,color,color,0);
- if (position_meeting(x+(a+.5)*32+1,y+sprite_height-1,objBlock) and position_meeting(x+(a+.5)*32+1,y+sprite_height+1,objBlock))
- draw_rectangle_color(x+(a+.5)*32,y+sprite_height-thickness-1,x+(a+.5)*32+thickness,y+sprite_height,color,color,color,color,0);
- }
- }
- }
- draw_set_blend_mode_ext(bm_dest_alpha, bm_one);
- draw_self();
- draw_set_blend_mode( bm_normal );
- surface_reset_target();
- }
- if surface_exists(surf)
- {
- draw_set_alpha(alpha)
- draw_surface(surf,0,0);
- draw_set_alpha(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement