设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3992|回复: 1
打印 上一主题 下一主题

[RMVX发布] 游戏中使画面全屏脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
56
在线时间
342 小时
注册时间
2011-10-29
帖子
368
跳转到指定楼层
1
 楼主| 发表于 2013-2-8 09:24:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
可以使画面变成全屏
而且比系统原来的全屏好一些

直接插入main前面
  1. [quote]    # 全屏脚本by yayapipi
  2.    
  3.     # 解释 :
  4.     #这个脚本比原来的全屏模式更好
  5.   
  6.     # 使用方法 :
  7.     #   Graphics.fullscreen?       : 回到全屏
  8.     #   Graphics.fullscreen_mode   : 进入全屏.
  9.     #   Graphics.windowed_mode     : 窗口模式  
  10.     #   Graphics.toggle_fullscreen : 从一个切换到其他
  11.     class << Graphics
  12.       fullscreen_start = false
  13.      
  14.       FindWindow       = Win32API.new('user32', 'FindWindow'      , 'pp'          , 'l')
  15.       CreateWindowEx   = Win32API.new('user32', 'CreateWindowEx'  , 'lpplllllllll', 'l')
  16.       UpdateWindow     = Win32API.new('user32', 'UpdateWindow'    , 'l'           , 'l')
  17.       ShowWindow       = Win32API.new('user32', 'ShowWindow'      , 'll'          , 'l')
  18.       SetWindowLong    = Win32API.new('user32', 'SetWindowLong'   , 'lll'         , 'l')
  19.       SetWindowPos     = Win32API.new('user32', 'SetWindowPos'    , 'lllllll'     , 'l')
  20.       GetSystemMetrics = Win32API.new('user32', 'GetSystemMetrics', 'l'           , 'l')
  21.       GetDC            = Win32API.new('user32', 'GetDC'           , 'l'           , 'l')
  22.       FillRect         = Win32API.new('user32', 'FillRect'        , 'lpl'         , 'l')
  23.       CreateSolidBrush = Win32API.new('gdi32' , 'CreateSolidBrush', 'l'           , 'l')
  24.       if first_start = !method_defined?(:zeus81_fullscreen_update)
  25.         @@MainWindow = FindWindow.call('RGSS Player', 0)
  26.         @@BackWindow = CreateWindowEx.call(0x08000008, 'Static', '', 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0)
  27.         @@FillRectArgs = [GetDC.call(@@BackWindow), [0,0,0xFFFF,0xFFFF].pack('L4'), CreateSolidBrush.call(0)]
  28.         @@fullscreen = false
  29.         alias zeus81_fullscreen_resize_screen resize_screen
  30.         alias zeus81_fullscreen_update        update
  31.       end
  32.       def update
  33.         zeus81_fullscreen_update
  34.         toggle_fullscreen if Input.trigger?(Input::F5)
  35.       end
  36.       def resize_screen(width, height)
  37.         zeus81_fullscreen_resize_screen(width, height)
  38.         fullscreen_mode if fullscreen?
  39.       end
  40.       def fullscreen?() @@fullscreen end
  41.       def toggle_fullscreen() fullscreen? ? windowed_mode : fullscreen_mode end
  42.       def fullscreen_mode
  43.         client_w, client_h = GetSystemMetrics.call(0), GetSystemMetrics.call(1)
  44.         w, h = client_w, client_w * height / width
  45.         h, w = client_h, client_h * width / height if h > client_h
  46.         ShowWindow.call(@@BackWindow, 3)
  47.         UpdateWindow.call(@@BackWindow)
  48.         FillRect.call(*@@FillRectArgs)
  49.         SetWindowPos.call(@@MainWindow, -1, (client_w-w)/2, (client_h-h)/2, w, h, 0)
  50.         SetWindowLong.call(@@MainWindow, -16, 0x14000000)
  51.         @@fullscreen = true
  52.       end
  53.       def windowed_mode
  54.         client_w, client_h = GetSystemMetrics.call(0), GetSystemMetrics.call(1)
  55.         w = width + GetSystemMetrics.call(5)*2 + 4
  56.         h = height + GetSystemMetrics.call(6)*2 + 4 + GetSystemMetrics.call(4)
  57.         ShowWindow.call(@@BackWindow, 0)
  58.         SetWindowPos.call(@@MainWindow, -2, (client_w-w)/2, (client_h-h)/2, w, h, 0)
  59.         SetWindowLong.call(@@MainWindow, -16, 0x14CA0000)
  60.         @@fullscreen = false
  61.       end
  62.       Graphics.fullscreen_mode if first_start and fullscreen_start
  63.     end[/quote]
复制代码
使用方法在脚本里有注明

评分

参与人数 1星屑 +15 收起 理由
冷徹心扉 + 15 精品文章

查看全部评分

Lv1.梦旅人

沉睡的八宝粥 

梦石
0
星屑
64
在线时间
832 小时
注册时间
2011-4-22
帖子
2996

短篇七萝莉正太组季军

2
发表于 2013-2-8 11:02:56 | 只看该作者
本帖最后由 八宝粥先生 于 2013-2-8 11:04 编辑

大叔,看好本区的名称了吗?原创技术发布区

可能是第11次应了签名档
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-27 06:08

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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