<undefined> 0 -1 -100 0 <undefined> <undefined> 1 603 7 0 0 -1 2 self 0 0 1 global.trialsurface = 0; /* i don't know how to work surfaces so i gave up enjoy this global var :cry: */ instance_create(160,120,oEditorCamera); cursor_active = 1; placed_objs = 0; trial_tab_bottom = instance_create(160,225,oEditorTab); 1 603 7 0 0 -1 2 self 0 0 1 // this is some temporary code to test clicking on specific areas if (cursor_active){ if (mouse_check_button(mb_left)){ var xx = floor(mouse_x/16)*16; var yy = floor(mouse_y/16)*16; with (oEditorSolid){ // a check to deny further placement of solids on top of each other if (x == xx && y == yy){ instance_destroy(); // if check confirms, turn the old one into dust // this probably isn't efficient but i do not care } } instance_create(xx,yy,oEditorSolid); placed_objs = get_obj_count(); } if (mouse_check_button(mb_right)){ with (oEditorSolid){ if (position_meeting(mouse_x,mouse_y,self)){ instance_destroy(); } } placed_objs = get_obj_count(); } } with (trial_tab_bottom){ if (position_meeting(mouse_x,mouse_y,self)){ offset = 30; other.cursor_active = 0; }else{ offset = 0; other.cursor_active = 1; } smoothset += (offset-smoothset)/5; } 1 603 7 0 0 -1 2 self 0 0 1 var cx = view_xview[0]; var cy = view_yview[0]; with (trial_tab_bottom){ x = 160+cx; y = (225-smoothset)+cy; } 1 603 7 0 0 -1 2 self 0 0 1 // surfaces are lame. you know what isn't lame? var cx = view_xview[0]; var cy = view_yview[0]; // spaghetti code from gms2 :) /* debug code, no longer necessary draw_set_font(fontGUI2Default); draw_set_color(c_white); draw_set_halign(fa_center); draw_text_border(120+cx,220+cy,"X: "+string(mouse_x)); draw_text_border(160+cx,220+cy,"Y: "+string(mouse_y)); draw_text_border(200+cx,220+cy,"CA: "+string(cursor_active)); */ // a forecast of the current object to be placed if (cursor_active){ var snap = 16; var xx = floor(mouse_x/snap)*snap; var yy = floor(mouse_y/snap)*snap; draw_sprite_ext(sSolid,0,xx,yy,1,1,0,c_white,0.3); } // the cursor too draw_set_alpha(1); draw_sprite(sEditorCursor,0,mouse_x,mouse_y); 0 0 0 0.5 0.100000001490116 0 0.100000001490116 0.100000001490116 0.200000002980232 -1 0