Advertisement
FlipelyFlip

OriginalWij - Scale Screen

Apr 6th, 2025
478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.99 KB | None | 0 0
  1. #==============================================================================
  2. # Scale
  3. #==============================================================================
  4. # Author  : OriginalWij
  5. # Version : 1.2
  6. #==============================================================================
  7.  
  8. #==============================================================================
  9. # To use:
  10. #   set the scale in the config below, the rest is automatic (Plug & Play)
  11. #==============================================================================
  12.  
  13. #==============================================================================
  14. # What this does:
  15. #   scales the game window to make it appear larger
  16. #==============================================================================
  17.  
  18. #==============================================================================
  19. # Config
  20. #==============================================================================
  21.  
  22. module OW_SCALE
  23.   # Factor to scale the game window by (do NOT scale = 1.00)
  24.   SCALE = 2.00
  25. end
  26.  
  27. #==============================================================================
  28. # Scale                                                                   [New]
  29. #==============================================================================
  30.  
  31. class Scale
  32.   #--------------------------------------------------------------------------
  33.   # Scale Game Window
  34.   #--------------------------------------------------------------------------
  35.   def self.game_window(scale = 1.00)
  36.     return 0 if scale == false
  37.     w, h = Graphics.width * scale, Graphics.height * scale
  38.     find = Win32API.new('user32', 'FindWindowEx', 'llpp', 'i')
  39.     size = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
  40.     move = Win32API.new('user32', 'MoveWindow', 'liiiil', 'l')
  41.     window = find.call(0, 0, 'RGSS Player', 0)
  42.     window_w, window_h = size.call(0), size.call(1)
  43.     move.call(window,(window_w - w) / 2,(window_h - h) / 2, w, h, 1)
  44.   end
  45. end
  46.  
  47. Scale.game_window(OW_SCALE::SCALE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement