查看: 5559|回复: 13

[有事请教] VA的游戏界面和分辨率一起放大的脚本?

[复制链接]

最萌的小猫

梦石
0
星屑
1347
在线时间
692 小时
注册时间
2011-11-5
回帖
3320
发表于 2018-7-28 04:54:24 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 houyuxiaoyang 于 2018-7-28 04:57 编辑

如题
说白了就是整体都放大2倍...
感觉应该蛮简单实现的,有能能改出来的方法最好,求助~~
附上一张新坑的截图,原创哦!
QQ图片20180728045320.png
小猫,感情浓郁的天然嘿啾一只,属性:水,嘿啾,无轨迹流线萌。喜欢在正午伸出小爪子卖着各种次元萌。平行穿越次元萌差。
如需要小猫,请认准啾怪时空电话。这宇宙萌源的秘密,需要找到时空边界萌源能量爆发的封印钥匙。快来和小猫一同去冒险吧!
梦石
0
星屑
3557
在线时间
2337 小时
注册时间
2015-8-25
回帖
928

开拓者

发表于 2018-7-28 06:27:30 | 显示全部楼层
本帖最后由 七重 于 2018-7-28 06:48 编辑

也就是倍放对吧?
cacao的主页里有一个。 但是要玩家自己按一下的。
说起来以前坛友发过一个可以制作者设置好之后,就一直是保持倍率的,我觉得更好。。(是英语区域的作者的)
但是我自己之前想找也没有找回来。

好像是这位坛友。。。。借这个机会如果方便的话也想再问一下。。。。@  shencao

--
追记,找到了。
[fold=使用说明]Fullscreen++ v2.0
by Zeus81​

New fullscreen mode that is more smart and make a better use of the screen surface (no black frame).
Alt+Enter still uses the old fullscreen mode, to use the new one press F5.
You can also press F6 to change the screen ratio, be it in fullscreen or windowed mode (both ratios are independents).
This script automatically saves the last configuration used in the Game.ini file (fullscreen mode & ratios) and restores it when you restart the game.
So before sharing your game do not forget to put the config you want by default, the first time we start your game.
The old fullscreen mode is still present, but you can disable it by setting true on line 9 (instead of false).
However it will also disable Alt+F4, and if you press Alt+Enter at the same time you can bypass the prohibition anyway.[/fold]

[fold=脚本][pre lang="ruby"]# Fullscreen++ v2.2 for VX and VXace by Zeus81
# Free for non commercial and commercial use
# Licence : http://creativecommons.org/licenses/by-sa/3.0/
# Contact : zeusex81@gmail.com
# (fr) Manuel d'utilisation : http://pastebin.com/raw.php?i=1TQfMnVJ
# (en) User Guide           : http://pastebin.com/raw.php?i=EgnWt9ur

$imported ||= {}
$imported[:Zeus_Fullscreen] = __FILE__

class << Graphics
  Disable_VX_Fullscreen = false

  CreateWindowEx            = Win32API.new('user32'  , 'CreateWindowEx'           , 'ippiiiiiiiii', 'i')
  GetClientRect             = Win32API.new('user32'  , 'GetClientRect'            , 'ip'          , 'i')
  GetDC                     = Win32API.new('user32'  , 'GetDC'                    , 'i'           , 'i')
  GetSystemMetrics          = Win32API.new('user32'  , 'GetSystemMetrics'         , 'i'           , 'i')
  GetWindowRect             = Win32API.new('user32'  , 'GetWindowRect'            , 'ip'          , 'i')
  FillRect                  = Win32API.new('user32'  , 'FillRect'                 , 'ipi'         , 'i')
  FindWindow                = Win32API.new('user32'  , 'FindWindow'               , 'pp'          , 'i')
  ReleaseDC                 = Win32API.new('user32'  , 'ReleaseDC'                , 'ii'          , 'i')
  SendInput                 = Win32API.new('user32'  , 'SendInput'                , 'ipi'         , 'i')
  SetWindowLong             = Win32API.new('user32'  , 'SetWindowLong'            , 'iii'         , 'i')
  SetWindowPos              = Win32API.new('user32'  , 'SetWindowPos'             , 'iiiiiii'     , 'i')
  ShowWindow                = Win32API.new('user32'  , 'ShowWindow'               , 'ii'          , 'i')
  SystemParametersInfo      = Win32API.new('user32'  , 'SystemParametersInfo'     , 'iipi'        , 'i')
  UpdateWindow              = Win32API.new('user32'  , 'UpdateWindow'             , 'i'           , 'i')
  GetPrivateProfileString   = Win32API.new('kernel32', 'GetPrivateProfileString'  , 'ppppip'      , 'i')
  WritePrivateProfileString = Win32API.new('kernel32', 'WritePrivateProfileString', 'pppp'        , 'i')
  CreateSolidBrush          = Win32API.new('gdi32'   , 'CreateSolidBrush'         , 'i'           , 'i')
  DeleteObject              = Win32API.new('gdi32'   , 'DeleteObject'             , 'i'           , 'i')

  unless method_defined?(:zeus_fullscreen_update)
    HWND     = FindWindow.call('RGSS Player', 0)
    BackHWND = CreateWindowEx.call(0x08000008, 'Static', '', 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0)
    alias zeus_fullscreen_resize_screen resize_screen
    alias zeus_fullscreen_update        update
  end
private
  def initialize_fullscreen_rects
    @borders_size    ||= borders_size
    @fullscreen_rect ||= screen_rect
    @workarea_rect   ||= workarea_rect
  end
  def borders_size
    GetWindowRect.call(HWND, wrect = [0, 0, 0, 0].pack('l4'))
    GetClientRect.call(HWND, crect = [0, 0, 0, 0].pack('l4'))
    wrect, crect = wrect.unpack('l4'), crect.unpack('l4')
    Rect.new(0, 0, wrect[2]-wrect[0]-crect[2], wrect[3]-wrect[1]-crect[3])
  end
  def screen_rect
    Rect.new(0, 0, GetSystemMetrics.call(0), GetSystemMetrics.call(1))
  end
  def workarea_rect
    SystemParametersInfo.call(0x30, 0, rect = [0, 0, 0, 0].pack('l4'), 0)
    rect = rect.unpack('l4')
    Rect.new(rect[0], rect[1], rect[2]-rect[0], rect[3]-rect[1])
  end
  def hide_borders() SetWindowLong.call(HWND, -16, 0x14000000) end
  def show_borders() SetWindowLong.call(HWND, -16, 0x14CA0000) end
  def hide_back()    ShowWindow.call(BackHWND, 0)              end
  def show_back
    ShowWindow.call(BackHWND, 3)
    UpdateWindow.call(BackHWND)
    dc    = GetDC.call(BackHWND)
    rect  = [0, 0, @fullscreen_rect.width, @fullscreen_rect.height].pack('l4')
    brush = CreateSolidBrush.call(0)
    FillRect.call(dc, rect, brush)
    ReleaseDC.call(BackHWND, dc)
    DeleteObject.call(brush)
  end
  def resize_window(w, h)
    if @fullscreen
      x, y, z = (@fullscreen_rect.width-w)/2, (@fullscreen_rect.height-h)/2, -1
    else
      w += @borders_size.width
      h += @borders_size.height
      x = @workarea_rect.x + (@workarea_rect.width  - w) / 2
      y = @workarea_rect.y + (@workarea_rect.height - h) / 2
      z = -2
    end
    SetWindowPos.call(HWND, z, x, y, w, h, 0)
  end
  def release_alt
    inputs = [1,18,2, 1,164,2, 1,165,2].pack('LSx2Lx16'*3)
    SendInput.call(3, inputs, 28)
  end
public
  def load_fullscreen_settings
    buffer = [].pack('x256')
    section = 'Fullscreen++'
    filename = './Game.ini'
    get_option = Proc.new do |key, default_value|
      l = GetPrivateProfileString.call(section, key, default_value, buffer, buffer.size, filename)
      buffer[0, l]
    end
    @fullscreen       = get_option.call('Fullscreen'     , '0') == '1'
    @fullscreen_ratio = get_option.call('FullscreenRatio', '0').to_i
    @windowed_ratio   = get_option.call('WindowedRatio'  , '1').to_i
    toggle_vx_fullscreen if Disable_VX_Fullscreen and vx_fullscreen?
    fullscreen? ? fullscreen_mode : windowed_mode
  end
  def save_fullscreen_settings
    section = 'Fullscreen++'
    filename = './Game.ini'
    set_option = Proc.new do |key, value|
      WritePrivateProfileString.call(section, key, value.to_s, filename)
    end
    set_option.call('Fullscreen'     , @fullscreen ? '1' : '0')
    set_option.call('FullscreenRatio', @fullscreen_ratio)
    set_option.call('WindowedRatio'  , @windowed_ratio)
  end
  def fullscreen?
    @fullscreen or vx_fullscreen?
  end
  def vx_fullscreen?
    rect = screen_rect
    rect.width == 640 and rect.height == 480
  end
  def toggle_fullscreen
    fullscreen? ? windowed_mode : fullscreen_mode
  end
  def toggle_vx_fullscreen
    windowed_mode if @fullscreen and !vx_fullscreen?
    inputs = [1,18,0, 1,13,0, 1,13,2, 1,18,2].pack('LSx2Lx16'*4)
    SendInput.call(4, inputs, 28)
    zeus_fullscreen_update
    self.ratio += 0 # refresh window size
  end
  def vx_fullscreen_mode
    return if vx_fullscreen?
    toggle_vx_fullscreen
  end
  def fullscreen_mode
    return if vx_fullscreen?
    initialize_fullscreen_rects
    show_back
    hide_borders
    @fullscreen = true
    self.ratio += 0 # refresh window size
  end
  def windowed_mode
    toggle_vx_fullscreen if vx_fullscreen?
    initialize_fullscreen_rects
    hide_back
    show_borders
    @fullscreen = false
    self.ratio += 0 # refresh window size
  end
  def toggle_ratio
    return if vx_fullscreen?
    self.ratio += 1
  end
  def ratio
    return 1 if vx_fullscreen?
    @fullscreen ? @fullscreen_ratio : @windowed_ratio
  end
  def ratio=(r)
    return if vx_fullscreen?
    initialize_fullscreen_rects
    r = 0 if r < 0
    if @fullscreen
      @fullscreen_ratio = r
      w_max, h_max = @fullscreen_rect.width, @fullscreen_rect.height
    else
      @windowed_ratio = r
      w_max = @workarea_rect.width  - @borders_size.width
      h_max = @workarea_rect.height - @borders_size.height
    end
    if r == 0
      w, h = w_max, w_max * height / width
      h, w = h_max, h_max * width / height if h > h_max
    else
      w, h = width * r, height * r
      return self.ratio = 0 if w > w_max or h > h_max
    end
    resize_window(w, h)
    save_fullscreen_settings
  end
  def update
    release_alt if Disable_VX_Fullscreen and Input.trigger?(Input::ALT)
    zeus_fullscreen_update
    toggle_fullscreen if Input.trigger?(Input::F5)
    toggle_ratio      if Input.trigger?(Input::F6)
  end
  def resize_screen(width, height)
    zeus_fullscreen_resize_screen(width, height)
    self.ratio += 0 # refresh window size
  end
end
Graphics.load_fullscreen_settings[/pre][/fold]

点评

试啦试啦!!!谢谢!!!  发表于 2018-7-28 09:08
我新给那个是有记忆功能的哟?不过要自己设置下,请再仔细看看吧。我以前是实现过的。但是今天我暂时空不出手。  发表于 2018-7-28 08:57
给你一个么么哒(*  ̄3)  发表于 2018-7-28 08:57
万分感谢!只可惜得按f5啊~  发表于 2018-7-28 08:51

评分

参与人数 1赞 +1 收起 理由
houyuxiaoyang + 1 塞糖

查看全部评分

回复 1 0

使用道具 举报

聪仔

梦石
0
星屑
6187
在线时间
3077 小时
注册时间
2013-12-26
回帖
3076
发表于 2018-7-28 06:53:53 | 显示全部楼层
楼上@shencao 失败了...

点评

嘻XD  发表于 2018-7-28 21:22
感谢at,虽然没我什么事了哈哈。 to 七重,找到了就好~这个脚本很好用我逢人便推,能给人留下印象我很开心XD  发表于 2018-7-28 11:49
谢谢,其实是因为我已经找到了,所以就把@隔开了,但是没有删除是因为已经@过了,所以就留个标记让对方知道。  发表于 2018-7-28 08:10
聪聪全国第三帅...
他们都叫我【人赢聪】
我的RM能力雷达图:

回复

使用道具 举报

老黄鸡

梦石
4
星屑
45692
在线时间
7947 小时
注册时间
2009-7-6
回帖
13335

MZ评测员RM创作大赛01组委会开拓者贵宾

发表于 2018-7-28 19:33:59 | 显示全部楼层
这个窗口放大脚本根据不同的用户环境放大方式不同,有的是临近,有的却是奇妙插值。
RGDirect - DirectX驱动的RGSS,点我了解.
(排满,暂停)RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复

使用道具 举报

梦石
0
星屑
3905
在线时间
1972 小时
注册时间
2013-1-3
回帖
9146
发表于 2018-7-29 10:57:05 | 显示全部楼层
小猫!!!好久不见!!!
不知道这种脚本有没有XP的

评分

参与人数 1赞 +1 收起 理由
houyuxiaoyang + 1 塞糖

查看全部评分

《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复

使用道具 举报

梦石
0
星屑
584
在线时间
448 小时
注册时间
2009-6-8
回帖
55
发表于 2018-10-11 18:34:56 | 显示全部楼层
zhe ge hen hao yong pei he geng gai fen bian lv

点评

这个很好用,配合更改分辨率  发表于 2018-10-11 19:59
http://share.renren.com/share/293782735/15182858551
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部