Advertisement
Guest User

display manager step event

a guest
Oct 15th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. //Window Drag
  2. if !window_get_fullscreen()
  3. {
  4. if !global.os_mobile
  5. {
  6. if mouse_check_button_pressed(mb_left)
  7. {
  8. mX = window_mouse_get_x();
  9. mY = window_mouse_get_y();
  10. }
  11.  
  12. if mouse_check_button(mb_left)
  13. {
  14. posX -= mX - window_mouse_get_x();
  15. posY -= mY - window_mouse_get_y();
  16. window_set_position(window_get_x() + posX, window_get_y() + posY);
  17. mX = window_mouse_get_x();
  18. mY = window_mouse_get_y();
  19. }
  20. }
  21. }
  22. else if zoom != max_zoom
  23. {
  24. zoom = max_zoom;
  25. show_debug_message("Zoom");
  26. window_set_size(ideal_width*zoom, ideal_height*zoom);
  27. surface_resize(application_surface, ideal_width*zoom, ideal_height*zoom);
  28. alarm[0]=1;
  29.  
  30. ini_open("options.ini");
  31. ini_write_real("Camera", "Zoom", obj_display_manager.zoom);
  32. ini_close();
  33. show_debug_message("Zoom saved!");
  34. }
  35. //Zoom Window
  36. if keyboard_check_pressed(vk_f11) || global.switchWindowMode
  37. {
  38. ini_open("options.ini");
  39. ini_write_real("Window", "Mode", !window_get_fullscreen());
  40. ini_close();
  41. window_set_fullscreen(!window_get_fullscreen());
  42. show_debug_message("Window mode saved!");
  43. window_set_size(ideal_width*zoom, ideal_height*zoom);
  44. global.switchWindowMode = false;
  45. }
  46. if keyboard_check_pressed(vk_f12) || global.changeScale// || keyboard_check_pressed(ord("Z"))
  47. {
  48. if !window_get_fullscreen()
  49. {
  50. show_debug_message("Zoom");
  51. if keyboard_check(vk_shift)
  52. zoom--;
  53. else
  54. zoom++;
  55.  
  56. if(zoom > max_zoom)
  57. zoom=1;
  58. else if zoom < 1
  59. zoom = max_zoom
  60.  
  61. ideal_width=round(ideal_height*aspect_ratio);
  62. if display_get_width() % ideal_width != 0
  63. {
  64. var _d = round(display_get_width()/ideal_width);
  65. ideal_width = display_get_width()/_d;
  66. }
  67. if display_get_height() % ideal_height != 0
  68. {
  69. var _d = round(display_get_height()/ideal_height);
  70. ideal_height = display_get_height()/_d;
  71. }
  72. if(ideal_width & 1)
  73. ideal_width++;
  74. if(ideal_height & 1)
  75. ideal_height++;
  76.  
  77. window_set_size(ideal_width*zoom, ideal_height*zoom);
  78. surface_resize(application_surface, ideal_width*zoom, ideal_height*zoom);
  79. alarm[0]=1;
  80.  
  81. ini_open("options.ini");
  82. ini_write_real("Camera", "Zoom", obj_display_manager.zoom);
  83. ini_close();
  84. show_debug_message("Zoom saved!");
  85. }
  86. global.changeScale = false;
  87. }
  88. //Set Cursor
  89. if window_get_fullscreen()
  90. window_set_cursor(cr_none);
  91. else
  92. window_set_cursor(cr_default);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement