赞 | 13 |
VIP | 642 |
好人卡 | 62 |
积分 | 27 |
经验 | 117527 |
最后登录 | 2024-10-4 |
在线时间 | 2630 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 2749
- 在线时间
- 2630 小时
- 注册时间
- 2013-1-16
- 帖子
- 5657
|
本帖最后由 myownroc 于 2014-7-13 10:14 编辑
在最前面加上if $game_switches[7] == true
在最后面相应的加上一个end
如下
if $game_switches[7] == true if $myfirst == nil $myfirst = 'myGod' 宽度=640+300 高度=480 游戏ini名=".\\Game.ini" val = "\0"*256 gps = Win32API.new('kernel32', 'GetPrivateProfileString','pppplp', 'l') gps.call("Game", "Title", "", val, 256, 游戏ini名) val.delete!("\0") title = val fw = Win32API.new('user32', 'FindWindow', 'pp', 'i') hWnd = fw.call("RGSS Player", title) swp = Win32API.new('user32', 'SetWindowPos', 'lliiiii', 'i') pointwds = [0,0,0,0].pack('llll') pointcet = [0, 0].pack('ll') wdsrect = Win32API.new('user32.dll', 'GetWindowRect', 'lp', 'l') client_screen = Win32API.new("user32", "ClientToScreen", 'ip', 'i') wdsrect.call(hWnd,pointwds) client_screen.call(hWnd, pointcet) wds = pointwds.unpack('llll') cet = pointcet.unpack('ll') addw = wds[2] - wds[0] - 640 addh = wds[3] - wds[1] - 480 x = wds[0] - (宽度 - 640) / 2 y = wds[1] - (高度 - 480) / 2 swp.call(hWnd, 0, x, y, 宽度 + addw, 高度 + addh, 0x20) end end
if $game_switches[7] == true
if $myfirst == nil
$myfirst = 'myGod'
宽度=640+300
高度=480
游戏ini名=".\\Game.ini"
val = "\0"*256
gps = Win32API.new('kernel32', 'GetPrivateProfileString','pppplp', 'l')
gps.call("Game", "Title", "", val, 256, 游戏ini名)
val.delete!("\0")
title = val
fw = Win32API.new('user32', 'FindWindow', 'pp', 'i')
hWnd = fw.call("RGSS Player", title)
swp = Win32API.new('user32', 'SetWindowPos', 'lliiiii', 'i')
pointwds = [0,0,0,0].pack('llll')
pointcet = [0, 0].pack('ll')
wdsrect = Win32API.new('user32.dll', 'GetWindowRect', 'lp', 'l')
client_screen = Win32API.new("user32", "ClientToScreen", 'ip', 'i')
wdsrect.call(hWnd,pointwds)
client_screen.call(hWnd, pointcet)
wds = pointwds.unpack('llll')
cet = pointcet.unpack('ll')
addw = wds[2] - wds[0] - 640
addh = wds[3] - wds[1] - 480
x = wds[0] - (宽度 - 640) / 2
y = wds[1] - (高度 - 480) / 2
swp.call(hWnd, 0, x, y, 宽度 + addw, 高度 + addh, 0x20)
end
end
@RyanBern 能不能帮忙先看一下……正在改卷中…… |
|