Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // -------------------------- Room --------------------------
- window_width = room_width;
- window_height = room_height;
- window_taskbar = 30;
- window_grab_x = 0;
- window_grab_y = 0;
- window_held = 0;
- if window_width = display_get_width() then window_set_position(0, 0);
- else window_center();
- if variable_local_exists("created") = 0 then created = 0;
- if created = 1
- begin
- menu_surface = surface_create(menu_size, menu_total*30+6);
- interface_tabstart = 0;
- interface_tabslots = floor(((window_height-36-1*23)/2)/23);
- interface_surface = surface_create(interface_size, interface_tabslots*23+6+interface_tabsize);
- editor_surface = surface_create(window_width-(2+menu_size)-(2+interface_size), window_height-36);
- editor_camera_x = (editor_tilesize*editor_surface_xsize*editor_room_xsize)/2;
- editor_camera_y = (editor_tilesize*editor_surface_ysize*editor_room_ysize)/2;
- editor_camera_xoffset = round(surface_get_width(editor_surface)/2);
- editor_camera_yoffset = round(surface_get_height(editor_surface)/2);
- exit;
- end;
- font_10 = font_add_sprite(spr_font_10, ord('!'), 1, 1);
- font_12 = font_add_sprite(spr_font_12, ord('!'), 1, 1);
- draw_set_valign(fa_middle);
- mx = 0;
- my = 0;
- ex = 0;
- ey = 0;
- grid_x = 0;
- grid_y = 0;
- scroll_percentage = 100;
- grid_xsize = 32;
- grid_ysize = 32;
- //-------------------------- Left menu --------------------------
- menu_current = 0;
- menu_size = 126;
- menu_total = 5;
- menu_surface = surface_create(menu_size, menu_total*30+6);
- menu_surface_height = surface_get_height(menu_surface);
- menu_update = 1;
- menu_switch = 1;
- menu_name[0] = "File";
- menu_name[1] = "Options";
- menu_name[2] = "Tiles";
- menu_name[3] = "Statistics";
- menu_name[4] = "Export";
- menu_height[0] = 100;
- menu_height[1] = 100;
- menu_height[2] = 100;
- menu_height[4] = 100;
- menu_height[5] = 100;
- //-------------------------- Functions --------------------------
- function_total[0] = 0;
- function_total[1] = 0;
- function_total[2] = 4;
- function_name[2, 0] = "Add Tilelayer";
- function_name[2, 1] = "Add Tileset";
- function_name[2, 2] = "Tile Normal";
- function_name[2, 3] = "Tile Random";
- function_name[2, 4] = "Add Tileset";
- function_total[3] = 0;
- function_total[4] = 0;
- function_size = 26;
- function_space = window_height-35-6-30*menu_total;
- function_start = 0;
- function_slots = floor(function_space/function_size);
- function_surface = surface_create(menu_size, function_total[0]*function_size+6);
- function_surface_height = surface_get_height(function_surface);
- function_update = 1;
- function_switch = 1;
- // -------------------------- LAYER tab --------------------------
- layer_total = 1;
- layer_current = 0;
- i = -1;
- repeat layer_total
- begin
- i += 1;
- layer = instance_create(0, 0, Layer);
- layer.layer_type = "T";
- layer.layer_name = "Tilelayer "+string(i+1);
- layer.layer_visible = 1;
- layer.layer_priority = i;
- end;
- // -------------------------- Interface control --------------------------
- interface_size = 290;
- interface_tabtotal = 1;
- interface_tabcurrent = 0;
- interface_tabsize = 17;
- interface_tabwidth = 60;
- interface_tabname[0] = "LAYERS";
- interface_space = floor((window_height-35-1-2*23)/2);
- interface_layerstart = 0;
- interface_layerslots = floor(interface_space/23);
- if interface_layerslots > 0 then interface_surface = surface_create(interface_size, 23+layer_total*23);
- else interface_surface = surface_create(interface_size, 23);
- interface_surface_height = surface_get_height(interface_surface);
- interface_update = 1;
- interface_switch = 1;
- // -------------------------- Place control --------------------------
- place_total = 0;
- place_current = 0;
- place_tabtotal = 1;
- place_tabcurrent = 0;
- place_tabwidth = 60;
- place_tabname[0] = "TILES";
- place_tabname[1] = "PAINT";
- place_tabname[2] = "LIGHT";
- place_tabname[3] = "LIGHTING";
- place_tiletotal = 0;
- place_tilestart = 0;
- place_tileslots = floor(interface_space/23);
- if place_tiletotal > 0 then place_surface = surface_create(interface_size, 23+place_tiletotal*23); // NEEDS UPDATE
- else place_surface = surface_create(interface_size, 23+23);
- place_surface_height = surface_get_height(place_surface);
- place_update = 1;
- place_switch = 1;
- // -------------------------- Editor --------------------------
- editor_surface = surface_create(window_width-(2+menu_size)-(2+interface_size), window_height-36);
- editor_surface_height = surface_get_height(editor_surface);
- editor_tilesize = 32;
- editor_surface_xsize = 4;
- editor_surface_ysize = 4;
- editor_room_xsize = 8;
- editor_room_ysize = 5;
- editor_camera_x = (editor_tilesize*editor_surface_xsize*editor_room_xsize)/2;
- editor_camera_y = (editor_tilesize*editor_surface_ysize*editor_room_ysize)/2;
- editor_camera_zoom = 100.00;
- editor_camera_zoom_target = 100.00;
- editor_camera_grab = 0;
- editor_camera_grabx = 0;
- editor_camera_graby = 0;
- editor_camera_animation_active = 0;
- editor_camera_animation_xstart = 0;
- editor_camera_animation_ystart = 0;
- editor_camera_animation_xend = 0;
- editor_camera_animation_yend = 0;
- editor_camera_xoffset = round(surface_get_width(editor_surface)/2);
- editor_camera_yoffset = round(surface_get_height(editor_surface)/2);
- editor_model = d3d_model_create();
- d3d_model_primitive_begin(editor_model, pr_linelist);
- xx = -editor_tilesize;
- repeat (editor_surface_xsize*editor_room_xsize)+1
- begin
- xx += editor_tilesize;
- d3d_model_vertex(editor_model, xx, 0, 0);
- d3d_model_vertex(editor_model, xx, editor_tilesize*editor_surface_ysize*editor_room_ysize, 0);
- end;
- yy = -editor_tilesize;
- repeat (editor_surface_ysize*editor_room_ysize)+1
- begin
- yy += editor_tilesize;
- d3d_model_vertex(editor_model, 0, yy, 0);
- d3d_model_vertex(editor_model, editor_tilesize*editor_surface_xsize*editor_room_xsize, yy, 0);
- end;
- d3d_model_primitive_end(editor_model);
- editor_update = 1;
- editor_switch = 1;
- // -------------------------- Finalize --------------------------
- if created = 0 then created = 1;
- // -------------------------- Message boxes --------------------------
- overlay_active = 0;
- overlay_function = "";
- overlay_mode = "";
- overlay_alpha = 0;
- overlay_tempname = "";
- overlay_layertarget = -1;
- overlay_stringlength = 0;
- overlay_stringmax = 24;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement