Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.22 KB | None | 0 0
  1. // -------------------------- Room --------------------------
  2.  
  3. window_width = room_width;
  4. window_height = room_height;
  5. window_taskbar = 30;
  6.  
  7. window_grab_x = 0;
  8. window_grab_y = 0;
  9. window_held = 0;
  10.  
  11. if window_width = display_get_width() then window_set_position(0, 0);
  12. else window_center();
  13.  
  14. if variable_local_exists("created") = 0 then created = 0;
  15. if created = 1
  16. begin
  17. menu_surface = surface_create(menu_size, menu_total*30+6);
  18.  
  19. interface_tabstart = 0;
  20. interface_tabslots = floor(((window_height-36-1*23)/2)/23);
  21. interface_surface = surface_create(interface_size, interface_tabslots*23+6+interface_tabsize);
  22.  
  23. editor_surface = surface_create(window_width-(2+menu_size)-(2+interface_size), window_height-36);
  24. editor_camera_x = (editor_tilesize*editor_surface_xsize*editor_room_xsize)/2;
  25. editor_camera_y = (editor_tilesize*editor_surface_ysize*editor_room_ysize)/2;
  26. editor_camera_xoffset = round(surface_get_width(editor_surface)/2);
  27. editor_camera_yoffset = round(surface_get_height(editor_surface)/2);
  28.  
  29. exit;
  30. end;
  31.  
  32. font_10 = font_add_sprite(spr_font_10, ord('!'), 1, 1);
  33. font_12 = font_add_sprite(spr_font_12, ord('!'), 1, 1);
  34. draw_set_valign(fa_middle);
  35.  
  36. mx = 0;
  37. my = 0;
  38. ex = 0;
  39. ey = 0;
  40. grid_x = 0;
  41. grid_y = 0;
  42.  
  43. scroll_percentage = 100;
  44.  
  45. grid_xsize = 32;
  46. grid_ysize = 32;
  47.  
  48. //-------------------------- Left menu --------------------------
  49.  
  50. menu_current = 0;
  51. menu_size = 126;
  52. menu_total = 5;
  53. menu_surface = surface_create(menu_size, menu_total*30+6);
  54. menu_surface_height = surface_get_height(menu_surface);
  55. menu_update = 1;
  56. menu_switch = 1;
  57.  
  58. menu_name[0] = "File";
  59. menu_name[1] = "Options";
  60. menu_name[2] = "Tiles";
  61. menu_name[3] = "Statistics";
  62. menu_name[4] = "Export";
  63.  
  64. menu_height[0] = 100;
  65. menu_height[1] = 100;
  66. menu_height[2] = 100;
  67. menu_height[4] = 100;
  68. menu_height[5] = 100;
  69.  
  70. //-------------------------- Functions --------------------------
  71.  
  72. function_total[0] = 0;
  73. function_total[1] = 0;
  74.  
  75. function_total[2] = 4;
  76. function_name[2, 0] = "Add Tilelayer";
  77. function_name[2, 1] = "Add Tileset";
  78. function_name[2, 2] = "Tile Normal";
  79. function_name[2, 3] = "Tile Random";
  80. function_name[2, 4] = "Add Tileset";
  81.  
  82. function_total[3] = 0;
  83. function_total[4] = 0;
  84.  
  85. function_size = 26;
  86. function_space = window_height-35-6-30*menu_total;
  87. function_start = 0;
  88. function_slots = floor(function_space/function_size);
  89. function_surface = surface_create(menu_size, function_total[0]*function_size+6);
  90. function_surface_height = surface_get_height(function_surface);
  91.  
  92. function_update = 1;
  93. function_switch = 1;
  94.  
  95. // -------------------------- LAYER tab --------------------------
  96.  
  97. layer_total = 1;
  98. layer_current = 0;
  99.  
  100. i = -1;
  101. repeat layer_total
  102. begin
  103. i += 1;
  104.  
  105. layer = instance_create(0, 0, Layer);
  106.  
  107. layer.layer_type = "T";
  108. layer.layer_name = "Tilelayer "+string(i+1);
  109. layer.layer_visible = 1;
  110. layer.layer_priority = i;
  111. end;
  112.  
  113. // -------------------------- Interface control --------------------------
  114.  
  115. interface_size = 290;
  116. interface_tabtotal = 1;
  117. interface_tabcurrent = 0;
  118. interface_tabsize = 17;
  119. interface_tabwidth = 60;
  120. interface_tabname[0] = "LAYERS";
  121.  
  122. interface_space = floor((window_height-35-1-2*23)/2);
  123. interface_layerstart = 0;
  124. interface_layerslots = floor(interface_space/23);
  125.  
  126. if interface_layerslots > 0 then interface_surface = surface_create(interface_size, 23+layer_total*23);
  127. else interface_surface = surface_create(interface_size, 23);
  128. interface_surface_height = surface_get_height(interface_surface);
  129.  
  130. interface_update = 1;
  131. interface_switch = 1;
  132.  
  133. // -------------------------- Place control --------------------------
  134.  
  135. place_total = 0;
  136. place_current = 0;
  137.  
  138. place_tabtotal = 1;
  139. place_tabcurrent = 0;
  140. place_tabwidth = 60;
  141. place_tabname[0] = "TILES";
  142. place_tabname[1] = "PAINT";
  143. place_tabname[2] = "LIGHT";
  144. place_tabname[3] = "LIGHTING";
  145.  
  146. place_tiletotal = 0;
  147. place_tilestart = 0;
  148. place_tileslots = floor(interface_space/23);
  149.  
  150. if place_tiletotal > 0 then place_surface = surface_create(interface_size, 23+place_tiletotal*23); // NEEDS UPDATE
  151. else place_surface = surface_create(interface_size, 23+23);
  152. place_surface_height = surface_get_height(place_surface);
  153.  
  154. place_update = 1;
  155. place_switch = 1;
  156.  
  157. // -------------------------- Editor --------------------------
  158.  
  159. editor_surface = surface_create(window_width-(2+menu_size)-(2+interface_size), window_height-36);
  160. editor_surface_height = surface_get_height(editor_surface);
  161. editor_tilesize = 32;
  162. editor_surface_xsize = 4;
  163. editor_surface_ysize = 4;
  164. editor_room_xsize = 8;
  165. editor_room_ysize = 5;
  166.  
  167. editor_camera_x = (editor_tilesize*editor_surface_xsize*editor_room_xsize)/2;
  168. editor_camera_y = (editor_tilesize*editor_surface_ysize*editor_room_ysize)/2;
  169. editor_camera_zoom = 100.00;
  170. editor_camera_zoom_target = 100.00;
  171. editor_camera_grab = 0;
  172. editor_camera_grabx = 0;
  173. editor_camera_graby = 0;
  174.  
  175. editor_camera_animation_active = 0;
  176. editor_camera_animation_xstart = 0;
  177. editor_camera_animation_ystart = 0;
  178. editor_camera_animation_xend = 0;
  179. editor_camera_animation_yend = 0;
  180.  
  181. editor_camera_xoffset = round(surface_get_width(editor_surface)/2);
  182. editor_camera_yoffset = round(surface_get_height(editor_surface)/2);
  183.  
  184. editor_model = d3d_model_create();
  185. d3d_model_primitive_begin(editor_model, pr_linelist);
  186. xx = -editor_tilesize;
  187. repeat (editor_surface_xsize*editor_room_xsize)+1
  188. begin
  189. xx += editor_tilesize;
  190. d3d_model_vertex(editor_model, xx, 0, 0);
  191. d3d_model_vertex(editor_model, xx, editor_tilesize*editor_surface_ysize*editor_room_ysize, 0);
  192. end;
  193. yy = -editor_tilesize;
  194. repeat (editor_surface_ysize*editor_room_ysize)+1
  195. begin
  196. yy += editor_tilesize;
  197. d3d_model_vertex(editor_model, 0, yy, 0);
  198. d3d_model_vertex(editor_model, editor_tilesize*editor_surface_xsize*editor_room_xsize, yy, 0);
  199. end;
  200. d3d_model_primitive_end(editor_model);
  201.  
  202. editor_update = 1;
  203. editor_switch = 1;
  204.  
  205. // -------------------------- Finalize --------------------------
  206.  
  207. if created = 0 then created = 1;
  208.  
  209. // -------------------------- Message boxes --------------------------
  210.  
  211. overlay_active = 0;
  212. overlay_function = "";
  213. overlay_mode = "";
  214. overlay_alpha = 0;
  215. overlay_tempname = "";
  216. overlay_layertarget = -1;
  217. overlay_stringlength = 0;
  218. overlay_stringmax = 24;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement