|
发表于 2011-4-27 10:02:06
|
显示全部楼层
回 楼主(secondsen) 的帖子
# lz,抱走了,用这dll,Graphics.resize_screen(width, height),width和height可以随便填吗,800x608和1280x720都行吗?
# 用下面的方法,这dll是否可以强制放大到800x600
class Win32API
GAME_INI_FILE = ".\\\\Game.ini"
def Win32API.GetPrivateProfileString(section, key)
val = "\\0"*256
gps = Win32API.new('kernel32', 'GetPrivateProfileString',%w(p p p p l p), 'l')
gps.call(section, key, "", val, 256, GAME_INI_FILE)
val.delete!("\\0")
return val
end
def Win32API.FindWindow(class_name, title)
fw = Win32API.new('user32', 'FindWindow', %(p, p), 'i')
hWnd = fw.call(class_name, title)
return hWnd
end
HWND_TOP = 0
HWND_TOPMOST = -1
SWP_NOMOVE = 2
def Win32API.SetWindowPos(hWnd, w, h)
swp = Win32API.new('user32', 'SetWindowPos', %(l, l, i, i, i, i, i), 'i')
ok = swp.call(hWnd, HWND_TOP, 120, 60, w, h, SWP_NOMOVE)
return ok
end
end
#以下是分辨率变更
title = Win32API.GetPrivateProfileString("Game", "Title")
hWnd = Win32API.FindWindow("RGSS Player", title)
#使用时X轴加6,Y轴加25,否则画面会变形
ok = Win32API.SetWindowPos(hWnd, 806, 625)
if(ok == 0)
p "失败"
end |
|