Project1

标题: 如何调整窗口 [打印本页]

作者: zdqhzs    时间: 2013-11-7 16:18
标题: 如何调整窗口
默认的游戏窗口有点过于小型,求问在什么地方可以自定义调整启动游戏后的窗口大小
作者: deeg    时间: 2013-11-7 16:36
http://rpg.blue/thread-216674-1-1.html
這裡有腳本,請自行參閱
作者: tseyik    时间: 2013-11-7 17:43
本帖最后由 tseyik 于 2013-11-7 17:45 编辑

Basic Window Resizer v1.1
先把這脚放在main脚本前
然後把main脚本改成(以下是2倍)
Window_Resize.r(1088, 828)
rgss_main { SceneManager.run }
  1. #Basic Window Resizer v1.1
  2. #----------#
  3. #Features: Allows you to resize the window to whatever size you like! (This is not
  4. # like Graphics.resize, this will scale to fit)
  5. #
  6. #Usage: Script calls:
  7. # Window_Resize.r(width, height) - Self-explanatory
  8. # Window_Resize.f - fits the game window to monitor size
  9. # Window_Resize.full - switches to full screen unless already fullscreened
  10. # Window_Resize.window - same as full but opposite
  11. #
  12. #No Customization
  13. #
  14. #----------#
  15. #-- Script by: V.M of D.T
  16. #--- Free to use in any project with credit given

  17. SWPO = Win32API.new 'user32', 'SetWindowPos', ['l','i','i','i','i','i','p'], 'i'
  18. WINX = Win32API.new 'user32', 'FindWindowEx', ['l','l','p','p'], 'i'
  19. SMET = Win32API.new 'user32', 'GetSystemMetrics', ['i'], 'i'

  20. module Window_Resize
  21. def self.r(width, height)
  22. resw = SMET.call(0)
  23. resh = SMET.call(1)
  24. window_loc = WINX.call(0,0,"RGSS Player",0)
  25. width += (SMET.call(5) + SMET.call(45)) * 2
  26. height += (SMET.call(6) + SMET.call(45)) * 2 + SMET.call(4)
  27. x = (resw - width) / 2; y = (resh - height) / 2
  28. y = 0 if y < 0;x = 0 if x < 0
  29. SWPO.call(window_loc,0,x,y,width,height,0)
  30. end
  31. def self.f
  32. resw = SMET.call(0)
  33. resh = SMET.call(1)
  34. window_loc = WINX.call(0,0,"RGSS Player",0)
  35. SWPO.call(window_loc,0,0,0,resw,resh,0)
  36. end
  37. def self.full
  38. resw = SMET.call(0)
  39. return unless resw > 640
  40. toggle
  41. end
  42. def self.window
  43. resw = SMET.call(0)
  44. return unless resw < 640
  45. toggle
  46. end
  47. def self.toggle
  48. keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v'
  49. keybd.call 0xA4, 0, 0, 0
  50. keybd.call 13, 0, 0, 0
  51. keybd.call 13, 0, 2, 0
  52. keybd.call 0xA4, 0, 2, 0
  53. end
  54. end
  55. #Basic Window Resizer v1.1
  56. #----------#
  57. #Features: Allows you to resize the window to whatever size you like! (This is not
  58. # like Graphics.resize, this will scale to fit)
  59. #
  60. #Usage: Script calls:
  61. # Window_Resize.r(width, height) - Self-explanatory
  62. # Window_Resize.f - fits the game window to monitor size
  63. # Window_Resize.full - switches to full screen unless already fullscreened
  64. # Window_Resize.window - same as full but opposite
  65. #
  66. #No Customization
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1