Advertisement
Guest User

Untitled

a guest
Nov 12th, 2017
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // CREATE
  2.  
  3. view_screen_width = 320
  4. view_screen_height = 240
  5.  
  6. window_pixel_scale = 2 // Размер пикселей
  7.  
  8. port_screen_width = view_screen_width * window_pixel_scale
  9. port_screen_height = view_screen_height * window_pixel_scale
  10.  
  11. window_set_size( port_screen_width, port_screen_height )
  12.  
  13. application_surface_draw_enable(false);
  14.  
  15. was_fullscreen = window_get_fullscreen()
  16.  
  17. MonitorW = display_get_width();
  18. MonitorH = display_get_height();
  19.  
  20. scale = min(MonitorW div view_screen_width, MonitorH div view_screen_height)
  21.  
  22. Xoffset = (MonitorW - view_screen_width  * scale) / 2
  23. Yoffset = (MonitorH - view_screen_height * scale) / 2
  24.  
  25. // STEP
  26.  
  27. if (window_get_fullscreen()) {
  28.     if was_fullscreen
  29.         exit
  30.     if window_get_width() != port_screen_width || window_get_height() != port_screen_height
  31.         window_set_size( port_screen_width, port_screen_height );
  32.     was_fullscreen = true
  33.  
  34. }
  35. else {
  36.     was_fullscreen = false
  37.     if window_get_width() != port_screen_width || window_get_height() != port_screen_height
  38.         window_set_size( port_screen_width, port_screen_height );
  39.  
  40. }
  41.  
  42. // PRE-DRAW
  43.  
  44. if (window_get_fullscreen())
  45. {
  46.     draw_surface_ext(application_surface,Xoffset,Yoffset,scale,scale,0,c_white,1)
  47. }
  48. else
  49. {
  50.     draw_surface_ext(application_surface,0,0,window_pixel_scale,window_pixel_scale,0,c_white,1)
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement