幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2383|回复: 1

[RMXP] 怎么调整主窗口分辨率,如默认的640*480调整成800*600

[复制链接]

1

主题

1

帖子

10

积分

②入门

积分
10
发表于 2010-12-1 10:55:58 | 显示全部楼层 |阅读模式
如题
回复

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2010-12-1 23:04:47 | 显示全部楼层
  1. if $myfirst == nil
  2.    
  3.    $myfirst = 'myGod'   
  4.    宽度=800
  5.    高度=600
  6.    游戏ini名=".\\\\Game.ini"
  7.    val = "\\0"*256
  8.    gps = Win32API.new('kernel32', 'GetPrivateProfileString','pppplp', 'l')
  9.    gps.call("Game", "Title", "", val, 256, 游戏ini名)
  10.    val.delete!("\\0")
  11.    title = val
  12.    fw = Win32API.new('user32', 'FindWindow', 'pp', 'i')
  13.    hWnd = fw.call("RGSS Player", title)
  14.    swp = Win32API.new('user32', 'SetWindowPos', 'lliiiii', 'i')
  15.    pointwds = [0,0,0,0].pack('llll')
  16.    pointcet = [0, 0].pack('ll')
  17.    wdsrect = Win32API.new('user32.dll', 'GetWindowRect', 'lp', 'l')
  18.    client_screen = Win32API.new("user32", "ClientToScreen", 'ip', 'i')
  19.    wdsrect.call(hWnd,pointwds)
  20.    client_screen.call(hWnd, pointcet)
  21.    wds = pointwds.unpack('llll')
  22.    cet = pointcet.unpack('ll')
  23.    addw =  wds[2] - wds[0] - 640
  24.    addh =  wds[3] - wds[1] - 480
  25.    x = wds[0] - (宽度 - 640) / 2
  26.    y = wds[1] - (高度 - 480) / 2
  27.    swp.call(hWnd, 0, x, y, 宽度 + addw, 高度 + addh, 0x20)
  28.    
  29. end
复制代码
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2024-4-19 08:44 , Processed in 0.028134 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表