设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 128|回复: 0

[转载发布] SCREEN SIZE for RMVXAce

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-3 14:36:20 | 显示全部楼层 |阅读模式
    SCREEN SIZE for RMVXAce
    Version: 1.0​




    Introduction
    I had been tinkering with the manipulation of the available gaming area for RPGMaker XP games. And I did well with a barebones script that did not require the use of any external .DLL outside of Win32 manipulations, a script based upon the work of Selwyn (formerly Squall).

    This specific script is an adapation of my XP version, but altered for use with RPGMaker VX Ace. Simpler in design due to updates made in the Viewport class and Weather system.

    The Game.Exe's Fullscreen mode reverts to a fixed 640x480 resolution so the [ALT]+[ENTER] key combination is disabled. Fullscreen mode is literally disabled by intent with this setup.



    Screenshots
    None.



    Script
    Spoiler: Script
                    Code:       
    1. #==============================================================================
    2. # ** SCREEN SIZE for VXACE
    3. #------------------------------------------------------------------------------
    4. #    Version 1.0
    5. #    By DerVVulfman
    6. #    04-13-2026 (MM-DD-YYYY)
    7. #    RGSS3 / RPGMaker VX Ace
    8. #==============================================================================
    9. #
    10. #  INTRODUCTION:
    11. #  =============
    12. #  I had been tinkering with the manipulation of the available gaming area for
    13. #  RPGMaker XP games.  And I did well with a barebones script that did not re-
    14. #  quire the use of any external .DLL outside of Win32 manipulations, a script
    15. #  based upon the work of Selwyn (formerly Squall).
    16. #
    17. #  This specific script is an adapation of my XP version,  but altered for use
    18. #  with RPGMaker VX Ace. Simpler in design due to updates made in the Viewport
    19. #  class and Weather system.
    20. #
    21. #  ALERT: The Game.Exe's Fullscreen mode reverts to a fixed 640x480 resolution
    22. #         so the [ALT]+[ENTER] key combination is disabled. Fullscreen mode is
    23. #         literally disabled by intent with this setup.
    24. #
    25. #
    26. #   ------------------------------------------------------------------------
    27. #
    28. #  INSTRUCTIONS:
    29. #  =============
    30. #  I would hope this is clear.  It is mostly plug-and-play, only requiring you
    31. #  to set some configurable values within the ScrnSize module  at the very top
    32. #  of the actual system code.  And all the variable options have detailed des-
    33. #  criptions of what is being set.
    34. #
    35. #  NOTE: If you are using  other scripts that perform alterations  to the size
    36. #        of screen contents (YanFly's Core as an example), ensure both are set
    37. #        to the same resolution.
    38. #
    39. #==============================================================================
    40. #
    41. #  COMPATABILITY:
    42. #  ==============
    43. #  Designed for RPGMaker VXAce.
    44. #
    45. #  Alters the screen size, so other scripts that adjust viewport settings will
    46. #  need to be likewise altered.
    47. #
    48. #
    49. #==============================================================================
    50. #
    51. #  CREDITS AND THANKS:
    52. #  ===================
    53. #  The very basics of this system  comes from the DLL-free version of Selwyn's
    54. #  resolution script.
    55. #
    56. #  And thanks goes to ViperDamascus  who was looking for a script  to increase
    57. #  VXAce's screen size beyond the 640x480 maximum.
    58. #
    59. #
    60. #==============================================================================
    61. #
    62. #  TERMS and CONDITIONS:
    63. #  =====================
    64. #  Free for use, even in commercial scripts. However, I require due credit for
    65. #  myself, Selwyn who crafted the basics, and ViperDamascus for the request.
    66. #
    67. #
    68. #==============================================================================
    69. #==============================================================================
    70. # ** ScrnSize
    71. #------------------------------------------------------------------------------
    72. #  This module handles the adjustable screen size for games that utilize
    73. #  resolution scripts to alter game window dimensions.
    74. #==============================================================================
    75. module ScrnSize
    76.   
    77.   
    78.   # GAME SCREEN RESOLUTION
    79.   # ======================
    80.   # The absolute necessity... defining the size of the visible area of your
    81.   # game on the screen. You will see below some dimensions tested, and then
    82.   # commented out. Even reducing the size to older RPGMaker 2000 scale exe-
    83.   # cuted just fine.
    84.   # < -- IT IS RECOMMENDED THAT THE DEFINED VALUES BE MULTIPLES OF 32! -- >
    85.   # -----------------------------------------------------------------------
    86.   #
    87.     Width     = 1280      # Screen area width in pixels
    88.     Height    = 736       # Screen area height in pixels.
    89. #    Width     = 640
    90. #    Height    = 480
    91. #    Width     = 320
    92. #    Height    = 200
    93.   
    94.   
    95.   # GAME INI NAMING
    96.   # ===============
    97.   # A necessity if you are renaming the Game Executable (eg Game.exe). When
    98.   # your game/project is run, it looks for its requisite .ini file which it
    99.   # assumes to have the same name as its executable. Many leave the name of
    100.   # the executable alone. But if you choose to rename Game.exe to Trek.exe,
    101.   # it will search for Trek.ini. And if the assumed ini does not exist, the
    102.   # game will fail.
    103.   #
    104.   # The resolution changing system relies upon retriving the windows handle
    105.   # for the game when it executes.  And for this, it needs the current name
    106.   # of the Game's INI file.  So if you do change the name of the executable
    107.   # (and thus the name of the INI), it needs the name defined below.
    108.   # -----------------------------------------------------------------------
    109.   #
    110.     INI_Name  = 'Game.ini'
    111.   # GAME EXECUTION SPEED
    112.   # ====================
    113.   # This is an old trick,  changing the speed of the executable to make the
    114.   # game itself run faster.  RPGMaker XP was set to a default 40 frames per
    115.   # second while RPGMaker VX and VXAce to a native 60 frames per second.
    116.   #
    117.   # -----------------------------------------------------------------------
    118.   # Changing this value affects all...  script/code speed,  character speed
    119.   # in the fieldmap, battle animations, and the like.
    120.   #
    121.   # RANGE: 10-120. VXAce will not exceed 120fps nor go slower than 10.
    122.   #
    123.   # NOTE: Smooth mode refreshes graphics ever frame based on this value.
    124.   #       Normal mode only refreshes every other frame.
    125.   # -----------------------------------------------------------------------
    126.   #
    127.     Graphics.frame_rate = 40  
    128. end
    129. #==============================================================================
    130. # ●● Resolution
    131. #------------------------------------------------------------------------------
    132. #  This module uses the Win32API to connect to the RPGMaker XP game window and
    133. #  re-sizes the window based on the game developer's preferences.
    134. #==============================================================================
    135. module Resolution
    136.   
    137.   #--------------------------------------------------------------------------
    138.   # ● instance variables
    139.   #--------------------------------------------------------------------------
    140.   attr_reader :state
    141.   
    142.   #--------------------------------------------------------------------------
    143.   # ● initialize
    144.   #--------------------------------------------------------------------------
    145.   def initialize
    146.    
    147.     # Acquire desired window settings from configuration
    148.     # ==================================================
    149.     @reswidth   = ScrnSize::Width
    150.     @resheight  = ScrnSize::Height
    151.    
    152.     # Set instance variables for calling basic Win32 functions
    153.     # ========================================================   
    154.     ini     = Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L')
    155.     title   = "\0" * 256
    156.    
    157.     # Get Window Title
    158.     # ================================================   
    159.     ini.call('Game', 'Title', '', title, 256, '.\\' + ScrnSize::INI_Name)
    160.     title.delete!("\0")
    161.    
    162.     # Acquire Metrics from the Win32 API
    163.     # ================================================   
    164.     @window       = Win32API.new('user32', 'FindWindow',       'PP',
    165.                     'I').call("RGSS Player", title)
    166.     @set_win_long = Win32API.new('user32', 'SetWindowLong',    'LIL', 'L')
    167.     @set_win_pos  = Win32API.new('user32', 'SetWindowPos',     'LLIIIII', 'I')
    168.     @gsm          = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')
    169.     @gcr          = Win32API.new('user32', 'GetClientRect',    'LP', 'I')
    170.     @kbe          = Win32API.new('user32', 'keybd_event',      'LLLL', '')
    171.     @gaks         = Win32API.new('user32', 'GetAsyncKeyState', 'L', 'I')
    172.    
    173.     # Render message and exit if size is not supported
    174.     # ================================================
    175.     @default_size = self.size
    176.     if size[0] < @reswidth or size[1] < @resheight
    177.       print(""#{title}" requires a minimum screen resolution " +
    178.             "of [#{@reswidth} x #{@resheight}]\r\n\r\n" +
    179.             "\tYour Resolution: [#{@default_size[0]} x #{@default_size[1]}]")
    180.       exit
    181.     end
    182.    
    183.     # Apply Resolution Change
    184.     # =======================
    185.     @state = "default"
    186.     self.default
    187.    
    188.   end
    189.   
    190.   #--------------------------------------------------------------------------
    191.   # ● fullscreen
    192.   #--------------------------------------------------------------------------
    193.   def fullscreen
    194.     #
    195.     @default_size = size
    196.     @set_win_long.call(@window, -16, 0x14000000)
    197.     @set_win_pos.call(@window, -1, 0, 0, (@reswidth+2), (@resheight+2), 64)
    198.     @state = "fullscreen"
    199.     #
    200.   end
    201.   
    202.   #--------------------------------------------------------------------------
    203.   # ● default
    204.   #--------------------------------------------------------------------------
    205.   def default
    206.     #
    207.     x = @default_size[0] / 2 - ((@reswidth/2) + 3)
    208.     y = @default_size[1] / 2 - ((@resheight/2) + 8)
    209.     @set_win_long.call(@window, -16, 0x14CA0000)
    210.     @set_win_pos.call(@window, 0, x, y, (@reswidth+8), (@resheight+27), 0)
    211.     @state = "default"
    212.     #
    213.   end
    214.   
    215.   #--------------------------------------------------------------------------
    216.   # ● trigger?(key)
    217.   #--------------------------------------------------------------------------
    218.   def trigger?(key)
    219.     #
    220.     return @gaks.call(key) & 0x01 == 1
    221.     #
    222.   end
    223.   
    224.   #--------------------------------------------------------------------------
    225.   # ● private
    226.   #--------------------------------------------------------------------------
    227.   private :fullscreen
    228.   private :default
    229.   private :trigger?
    230.   
    231.   #--------------------------------------------------------------------------
    232.   # ● size
    233.   #--------------------------------------------------------------------------
    234.   def size
    235.     #
    236.     width   = @gsm.call(0)
    237.     height  = @gsm.call(1)
    238.     return width, height
    239.     #
    240.   end
    241.   #--------------------------------------------------------------------------
    242.   # ● change
    243.   #--------------------------------------------------------------------------
    244.   def change
    245.     #
    246.     if @state == "default"
    247.       self.fullscreen
    248.     else
    249.       self.default
    250.     end
    251.     #
    252.   end
    253.   #--------------------------------------------------------------------------
    254.   # ● update
    255.   #--------------------------------------------------------------------------
    256.   def update
    257.     #
    258.     if trigger?(121) # F10
    259.       self.change
    260.     end
    261.     if Input.trigger?(Input::ALT) or Input.press?(Input::ALT)
    262.       @kbe.call(18, 0, 2, 0)
    263.     end
    264.     #
    265.   end
    266.   #--------------------------------------------------------------------------
    267.   # ● module functions
    268.   #--------------------------------------------------------------------------
    269.   module_function :initialize
    270.   module_function :fullscreen
    271.   module_function :default
    272.   module_function :trigger?
    273.   module_function :size
    274.   module_function :change
    275.   module_function :update
    276.   #
    277. end
    278. #==============================================================================
    279. # ●● Input
    280. #------------------------------------------------------------------------------
    281. #  A class that handles input data from a gamepad or keyboard.
    282. #==============================================================================
    283. class << Input
    284.   
    285.   #--------------------------------------------------------------------------
    286.   # ● Alias Listings (with F12 Stack prevention)
    287.   #--------------------------------------------------------------------------
    288.   alias res_update update unless $@
    289.   
    290.   #--------------------------------------------------------------------------
    291.   # ● Input.update
    292.   #--------------------------------------------------------------------------
    293.   def Input.update
    294.     # Perform the original call
    295.     res_update
    296.     # Update the Resolution
    297.     Resolution.update
    298.   end
    299. end
    300. # Execute at start
    301. Resolution.initialize
    复制代码




    Instructions
    Plenty, and in the script.



    Compatibility
    Designed for RPGMaker XP

    Alters the screen size, so other scripts that adjust viewport settings will need to be likewise altered.



    Credits and Thanks
    The very basics of this system comes from the DLL-free version of Selwyn's resolution script.

    And thanks goes to ViperDamascus who was looking for a script to increase VXAce's screen size beyond the 640x480 maximum.



    Terms and Conditions
    Free for use, even in commercial scripts. However, I require due credit for myself, Selwyn who crafted the basics, and ViperDamascus for the request.


    本贴来自国际rpgmaker官方论坛作者:DerVVulfman处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/screen-size-for-rmvxace.183264/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 06:19 , Processed in 0.104064 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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