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

Project1

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

[已经解决] VA开始时全屏

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2014-1-13
帖子
57
跳转到指定楼层
1
发表于 2014-4-3 00:43:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如何加一个脚本或是修改使刚开启游戏时就自动全屏?

点评

ALT+G,有设置全屏启动。  发表于 2014-4-3 22:19

Lv2.观梦者 (暗夜天使)

梦石
0
星屑
266
在线时间
2355 小时
注册时间
2009-3-13
帖子
2309

贵宾

2
发表于 2014-4-3 11:52:22 | 只看该作者
http://rpg.blue/thread-347535-1-1.html 这个里面有这个功能
只需要里面的这个“† NovaBase v10015” 脚本和 DLL。
然后在mian 前加入
  1. API_.call 'SiNova|FWSwitch|i|v', 1
复制代码
就可以了

评分

参与人数 1星屑 +150 收起 理由
taroxd + 150 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
22713
在线时间
8623 小时
注册时间
2011-12-31
帖子
3367
3
发表于 2014-4-3 13:13:59 | 只看该作者
本帖最后由 tseyik 于 2014-4-3 13:22 编辑

加入這脚本
  1. #******************************************************************************
  2. #
  3. #    * 簡便設定全画面
  4. #
  5. #  --------------------------------------------------------------------------
  6. #    バージョン :  1.0.1
  7. #    対      応 :  RPGツクールVX /VA
  8. #    制  作  者 :  CACAO
  9. #    配  布  元 :  http://cacaosoft.web.fc2.com/
  10. #  --------------------------------------------------------------------------
  11. #   == 摘    要 ==
  12. #
  13. #   : 添加改變視窗大小功能。
  14. #
  15. #  --------------------------------------------------------------------------
  16. #   == 使用方法 ==
  17. #
  18. #    ★ WLIB::SetGameWindowSize(width, height)
  19. #     視窗移動到中心、然後更改指定的尺寸。
  20. #     参数為負数、或大放桌面會改成全画面。
  21. #     處理失敗時會返回 false 。
  22. #
  23. #
  24. #******************************************************************************


  25. #==============================================================================
  26. # ◆ 使用者設定
  27. #==============================================================================
  28. module WND_SIZE
  29.   #--------------------------------------------------------------------------
  30.   # ◇ 変更鍵
  31.   #--------------------------------------------------------------------------
  32.   #     nil .. 不調整大小
  33.   #--------------------------------------------------------------------------
  34.   INPUT_KEY = :F5
  35.   #--------------------------------------------------------------------------
  36.   # ◇ 大小列表
  37.   #--------------------------------------------------------------------------
  38.   #     [ [横幅, 縦幅], ... ] 以二個数据為一組設置。
  39.   #     設為 0 則為全画面。
  40.   #--------------------------------------------------------------------------
  41.   SIZE_LIST = [ [544,416], [640,480], [800,600], [1088,832], [0,0] ]
  42.   #--------------------------------------------------------------------------
  43.   # ◇ 儲存
  44.   #--------------------------------------------------------------------------
  45.   #   設定視窗大小状況儲存的文件名。
  46.   #   如果為零,則它不保存大小。
  47.   #--------------------------------------------------------------------------
  48.   FILE_SAVE = "System/test"
  49. end


  50. #/////////////////////////////////////////////////////////////////////////////#
  51. #                                                                             #
  52. #                     下面的腳本不需要改變。                       #
  53. #                                                                             #
  54. #/////////////////////////////////////////////////////////////////////////////#


  55. module WLIB
  56.   #--------------------------------------------------------------------------
  57.   # ● 定数
  58.   #--------------------------------------------------------------------------
  59.   # SystemMetrics
  60.   SM_CYCAPTION  = 0x04                    
  61.   SM_CXDLGFRAME = 0x07                    
  62.   SM_CYDLGFRAME = 0x08                    
  63.   # SetWindowPos
  64.   SWP_NOSIZE     = 0x01                  
  65.   SWP_NOMOVE     = 0x02                  
  66.   SWP_NOZORDER   = 0x04                  
  67.   #--------------------------------------------------------------------------
  68.   # ● Win32API
  69.   #--------------------------------------------------------------------------
  70.   @@FindWindow =
  71.     Win32API.new('user32', 'FindWindow', 'pp', 'l')
  72.   @@GetDesktopWindow =
  73.     Win32API.new('user32', 'GetDesktopWindow', 'v', 'l')
  74.   @@SetWindowPos =
  75.     Win32API.new('user32', 'SetWindowPos', 'lliiiii', 'i')
  76.   @@GetClientRect =
  77.     Win32API.new('user32', 'GetClientRect', 'lp', 'i')
  78.   @@GetWindowRect =
  79.     Win32API.new('user32', 'GetWindowRect', 'lp', 'i')
  80.   @@GetWindowLong =
  81.     Win32API.new('user32', 'GetWindowLong', 'li', 'l')
  82.   @@GetSystemMetrics =
  83.     Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
  84.   @@SystemParametersInfo =
  85.     Win32API.new('user32', 'SystemParametersInfo', 'iipi', 'i')
  86.   #--------------------------------------------------------------------------
  87.   # ● 視窗情報
  88.   #--------------------------------------------------------------------------
  89.   GAME_TITLE  = load_data("Data/System.rvdata2").game_title.encode('SHIFT_JIS')
  90.   GAME_HANDLE = @@FindWindow.call("RGSS Player", GAME_TITLE)
  91.   # GAME_HANDLE = Win32API.new('user32', 'GetForegroundWindow', 'v', 'l').call
  92.   GAME_STYLE   = @@GetWindowLong.call(GAME_HANDLE, -16)
  93.   GAME_EXSTYLE = @@GetWindowLong.call(GAME_HANDLE, -20)
  94.   HDSK = @@GetDesktopWindow.call

  95. module_function
  96.   #--------------------------------------------------------------------------
  97.   # ● GetWindowRect
  98.   #--------------------------------------------------------------------------
  99.   def GetWindowRect(hwnd)
  100.     r = [0,0,0,0].pack('l4')
  101.     if @@GetWindowRect.call(hwnd, r) != 0
  102.       result = Rect.new(*r.unpack('l4'))
  103.       result.width -= result.x
  104.       result.height -= result.y
  105.     else
  106.       result = nil
  107.     end
  108.     return result
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ● GetClientRect
  112.   #--------------------------------------------------------------------------
  113.   def GetClientRect(hwnd)
  114.     r = [0,0,0,0].pack('l4')
  115.     if @@GetClientRect.call(hwnd, r) != 0
  116.       result = Rect.new(*r.unpack('l4'))
  117.     else
  118.       result = nil
  119.     end
  120.     return result
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● GetSystemMetrics
  124.   #--------------------------------------------------------------------------
  125.   def GetSystemMetrics(index)
  126.     @@GetSystemMetrics.call(index)
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # ● SetWindowPos
  130.   #--------------------------------------------------------------------------
  131.   def SetWindowPos(hwnd, x, y, width, height, z, flag)
  132.     @@SetWindowPos.call(hwnd, z, x, y, width, height, flag) != 0
  133.   end

  134.   #--------------------------------------------------------------------------
  135.   # ● ウィンドウのサイズを取得
  136.   #--------------------------------------------------------------------------
  137.   def GetGameWindowRect
  138.     GetWindowRect(GAME_HANDLE)
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● ウィンドウのクライアントサイズを取得
  142.   #--------------------------------------------------------------------------
  143.   def GetGameClientRect
  144.     GetClientRect(GAME_HANDLE)
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ● デスクトップのサイズを取得
  148.   #--------------------------------------------------------------------------
  149.   def GetDesktopRect
  150.     r = [0,0,0,0].pack('l4')
  151.     if @@SystemParametersInfo.call(0x30, 0, r, 0) != 0
  152.       result = Rect.new(*r.unpack('l4'))
  153.       result.width -= result.x
  154.       result.height -= result.y
  155.     else
  156.       result = nil
  157.     end
  158.     return result
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● 取得視窗大小
  162.   #--------------------------------------------------------------------------
  163.   def GetFrameSize
  164.     return [
  165.       GetSystemMetrics(SM_CYCAPTION),   # タイトルバー
  166.       GetSystemMetrics(SM_CXDLGFRAME),  # 左右フレーム
  167.       GetSystemMetrics(SM_CYDLGFRAME)   # 上下フレーム
  168.     ]
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ● 変更視窗位置
  172.   #--------------------------------------------------------------------------
  173.   def MoveGameWindow(x, y)
  174.     SetWindowPos(GAME_HANDLE, x, y, 0, 0, 0, SWP_NOSIZE|SWP_NOZORDER)
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ● 視窗位置到中央
  178.   #--------------------------------------------------------------------------
  179.   def MoveGameWindowCenter
  180.     dr = GetDesktopRect()
  181.     wr = GetGameWindowRect()
  182.     x = (dr.width - wr.width) / 2
  183.     y = (dr.height - wr.height) / 2
  184.     SetWindowPos(GAME_HANDLE, x, y, 0, 0, 0, SWP_NOSIZE|SWP_NOZORDER)
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ● 変更視窗大小
  188.   #--------------------------------------------------------------------------
  189.   def SetGameWindowSize(width, height)
  190.     # 各領域取得
  191.     dr = GetDesktopRect()         
  192.     wr = GetGameWindowRect()      
  193.     cr = GetGameClientRect()      
  194.     return false unless dr && wr && cr
  195.     # 取得幀大小
  196.     frame = GetFrameSize()
  197.     ft = frame[0] + frame[2]      
  198.     fl = frame[1]                 
  199.     fs = frame[1] * 2            
  200.     fb = frame[2]                 
  201.     if width <= 0 || height <= 0 || width >= dr.width || height >= dr.height
  202.       w = dr.width + fs
  203.       h = dr.height + ft + fb
  204.       SetWindowPos(GAME_HANDLE, -fl, -ft, w, h, 0, SWP_NOZORDER)
  205.     else
  206.       w = width + fs
  207.       h = height + ft + fb
  208.       SetWindowPos(GAME_HANDLE, 0, 0, w, h, 0, SWP_NOMOVE|SWP_NOZORDER)
  209.       MoveGameWindowCenter()
  210.     end
  211.   end
  212. end

  213. class Scene_Base
  214.   #--------------------------------------------------------------------------
  215.   # ●
  216.   #--------------------------------------------------------------------------
  217.   @@screen_mode = 0
  218.   #--------------------------------------------------------------------------
  219.   # ●
  220.   #--------------------------------------------------------------------------
  221.   def self.screen_mode=(index)
  222.     @@screen_mode = index % WND_SIZE::SIZE_LIST.size
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ●
  226.   #--------------------------------------------------------------------------
  227.   def self.screen_mode
  228.     @@screen_mode
  229.   end
  230.   #--------------------------------------------------------------------------
  231.   # ○ 幀更新
  232.   #--------------------------------------------------------------------------
  233.   alias _cao_update_wndsize update
  234.   def update
  235.     _cao_update_wndsize
  236.     if Input.trigger?(WND_SIZE::INPUT_KEY) && WLIB::GAME_HANDLE != 0
  237.       Scene_Base.screen_mode += 1
  238.       if WLIB::SetGameWindowSize(*WND_SIZE::SIZE_LIST[@@screen_mode])
  239.         if WND_SIZE::FILE_SAVE
  240.           save_data(Scene_Base.screen_mode, WND_SIZE::FILE_SAVE)
  241.         end
  242.       else
  243.         Sound.play_buzzer
  244.       end
  245.     end
  246.   end
  247. end

  248. module WND_SIZE
  249.   #--------------------------------------------------------------------------
  250.   # ● 除去太大的設定
  251.   #--------------------------------------------------------------------------
  252.   def self.remove_large_window
  253.     dr = WLIB::GetDesktopRect()
  254.     WND_SIZE::SIZE_LIST.reject! do |wsz|
  255.       wsz.size != 2 || dr.width < wsz[0] || dr.height < wsz[1]
  256.     end
  257.     if WND_SIZE::SIZE_LIST.empty?
  258.       WND_SIZE::SIZE_LIST << [Graphics.width, Graphics.height]
  259.     end
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ● 初期大小設定
  263.   #--------------------------------------------------------------------------
  264.   def self.init_window_size
  265.     if WND_SIZE::FILE_SAVE && File.file?(WND_SIZE::FILE_SAVE)
  266.       Scene_Base.screen_mode = load_data(WND_SIZE::FILE_SAVE)
  267.       WLIB::SetGameWindowSize(*WND_SIZE::SIZE_LIST[Scene_Base.screen_mode])
  268.     end
  269.   end
  270. end

  271. WND_SIZE.remove_large_window
  272. WND_SIZE.init_window_size
复制代码
然後Main加入WLIB::SetGameWindowSize(0, 0)
例:
WLIB::SetGameWindowSize(0, 0)
Font.default_name = 'PMingLiU'
rgss_main { SceneManager.run }

這脚本按F5可切換解象度,[544,416]>[640,480]>[800,600]> [1088,832]>全画面>[544,416]
若不使用這功能可把脚本中的

  INPUT_KEY = :F5
  改成
  INPUT_KEY =nil

评分

参与人数 1星屑 +100 收起 理由
taroxd + 100 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2014-1-13
帖子
57
4
 楼主| 发表于 2014-4-23 20:28:51 | 只看该作者
Sion 发表于 2014-4-3 11:52
http://rpg.blue/thread-347535-1-1.html 这个里面有这个功能
只需要里面的这个“† NovaBase v10015 ...

谢谢啦!成功了!(*^__^*)
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
30 小时
注册时间
2014-4-13
帖子
18
5
发表于 2014-5-10 20:46:14 | 只看该作者
如果要,那就按F1设置全屏启动。
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-25 09:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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