查看: 2657|回复: 3

[已经解决] 【纯新】这个全屏代码怎么用

[复制链接]
梦石
0
星屑
175
在线时间
51 小时
注册时间
2013-12-10
回帖
24
发表于 2013-12-10 22:29:56 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
  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.      
  18.     SWPO = Win32API.new 'user32', 'SetWindowPos', ['l','i','i','i','i','i','p'], 'i'
  19.     WINX = Win32API.new 'user32', 'FindWindowEx', ['l','l','p','p'], 'i'
  20.     SMET = Win32API.new 'user32', 'GetSystemMetrics', ['i'], 'i'
  21.      
  22.     module Window_Resize
  23.       def self.r(width, height)
  24.         resw = SMET.call(0)
  25.         resh = SMET.call(1)
  26.         window_loc = WINX.call(0,0,"RGSS Player",0)
  27.         width += (SMET.call(5) + SMET.call(45)) * 2
  28.         height += (SMET.call(6) + SMET.call(45)) * 2 + SMET.call(4)
  29.         x = (resw - width) / 2; y = (resh - height) / 2
  30.         y = 0 if y < 0;x = 0 if x < 0
  31.         SWPO.call(window_loc,0,x,y,width,height,0)
  32.       end
  33.       def self.f
  34.         resw = SMET.call(0)
  35.         resh = SMET.call(1)
  36.         window_loc = WINX.call(0,0,"RGSS Player",0)
  37.         SWPO.call(window_loc,0,0,0,resw,resh,0)
  38.       end
  39.       def self.full
  40.         resw = SMET.call(0)
  41.         return unless resw > 640
  42.         toggle
  43.       end
  44.       def self.window
  45.         resw = SMET.call(0)
  46.         return unless resw < 640
  47.         toggle
  48.       end
  49.       def self.toggle
  50.         keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v'
  51.         keybd.call 0xA4, 0, 0, 0
  52.         keybd.call 13, 0, 0, 0
  53.         keybd.call 13, 0, 2, 0
  54.         keybd.call 0xA4, 0, 2, 0
  55.       end
  56.     end
  57. #Basic Window Resizer v1.1
  58. #----------#
  59. #Features: Allows you to resize the window to whatever size you like! (This is not
  60. #            like Graphics.resize, this will scale to fit)
  61. #
  62. #Usage:   Script calls:
  63. #           Window_Resize.r(width, height)     - Self-explanatory
  64. #           Window_Resize.f                    - fits the game window to monitor size
  65. #           Window_Resize.full                 - switches to full screen unless already fullscreened
  66. #           Window_Resize.window               - same as full but opposite
  67. #
  68. #No Customization
  69. #↑↑↑这代码放在哪啊???? 放main里面改(width, height)就出错
复制代码
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2013-12-10 23:12:08 | 显示全部楼层
在脚本使用以下三種指令
Window_Resize.r(width, height)     -更改成指定解象度,例:Window_Resize.r(1088, 818)
Window_Resize.f                    - 配合画面改成全屏
Window_Resize.full                 - 切換到全屏
回复

使用道具 举报

梦石
0
星屑
175
在线时间
51 小时
注册时间
2013-12-10
回帖
24
 楼主| 发表于 2013-12-10 23:17:52 | 显示全部楼层
tseyik 发表于 2013-12-10 23:12
在脚本使用以下三種指令
Window_Resize.r(width, height)     -更改成指定解象度,例:Window_Resize.r(1088, ...

我把它放在Main里没错吧

点评

可以,但要放在rgss_main { SceneManager.run }之前,也可在亊件指令中使用脚本調用  发表于 2013-12-10 23:34
回复

使用道具 举报

梦石
0
星屑
175
在线时间
51 小时
注册时间
2013-12-10
回帖
24
 楼主| 发表于 2013-12-10 23:43:18 | 显示全部楼层
@tseyik 但是又出现了按键问题.... 动不了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部