Project1
标题:
求懂脚本的大大帮改下这个窗口化脚本吧!应该很简单的!
[打印本页]
作者:
雷影
时间:
2014-10-11 00:43
标题:
求懂脚本的大大帮改下这个窗口化脚本吧!应该很简单的!
本来觉得游戏窗口很小,找了一下在这里找到个拉伸窗口的简单脚本,可以在游戏启动是自动拉大窗口到设定好的大小。
希望大大能在此脚本里加工一下放几个窗口大小的分支,能做到以下效果!
游戏启动可以靠选择框来改变窗口大小!最好能在事件中自由调用脚本!
效果1:和NPC对话出现选择框,选A是800x600窗口,选B1024x768窗口,选择C取消改变。
效果2:菜单中多一个“设置”指令,进入后打开窗口设置选项,选A是800x600窗口,选B1024x768窗口,选择C取消改变。
或者:也可以把脚本写成,游戏启动后按F4就可以调整几种类型窗口大小。
PS:不知道能不能做到还可以选择自适应当前显示器合适的大小呢?
代码放上,相当简单的:
#给下面高度宽度赋值,就是分辨率的大小。
宽度=1024 #1018(全屏窗口大概的大小)
高度=768 #746 (全屏窗口大概的大小)
游戏ini名=".\\Game.ini"
#============================================================================
val = "\0"*256
gps = Win32API.new('kernel32', 'GetPrivateProfileString',%w(p p p p l p), 'l')
gps.call("Game", "Title", "", val, 256, 游戏ini名)
title = val
fw = Win32API.new('user32', 'FindWindow', %(p, p), 'i')
hWnd = fw.call("RGSS Player", title)
swp = Win32API.new('user32', 'SetWindowPos', %(l, l, i, i, i, i, i), 'i')
ok = swp.call(hWnd, 0, 0, 0, 宽度, 高度, 4)
复制代码
作者:
tseyik
时间:
2014-10-11 08:22
本帖最后由 tseyik 于 2014-10-11 08:25 编辑
有現成的腳本可做到
http://cacaosoft.web.fc2.com/tkool/script/rgss3/wndsz.html
作者:
雷影
时间:
2014-10-12 04:22
tseyik 发表于 2014-10-11 08:22
有現成的腳本可做到
http://cacaosoft.web.fc2.com/tkool/script/rgss3/wndsz.html
地址打不开啊!!可以的话把代码贴出来吧
作者:
永燃的狂炎
时间:
2014-10-12 21:48
#===========================================================================#
# #*****************# Game Resolution 1.1 #
# #*** By Falcao ***# Add the resolution option to the menu #
# #*****************# RMVXACE Date Aungust 6 2012 #
#===========================================================================#
#---------------------------------------------------------------------------
# This script add a resolution option to the game menu, you can choose from
# Normal screen 544 x 416 and Full screen, also it remember your last option
# when you start the game.
#
# Installation: copy and paste above main
#--------------------------------------------------------------------------
module FalRes
def self.write_decision
File.delete("System/Resolution.txt") rescue nil
File.open("System/Resolution.txt","a+") {|fh|fh.puts($game_resolution)}
end
def self.read_decision
decision = File.read("System/Resolution.txt").split("\n") rescue [0]
return decision.last.to_i
end
def self.resolution
res = Win32API.new 'user32', 'keybd_event', %w(l l l l), ''
res.call(18,0,0,0)
res.call(13,0,0,0)
res.call(13,0,2,0)
res.call(18,0,2,0)
end
$game_resolution = self.read_decision
self.resolution if $game_resolution == 1
end
class Window_MenuCommand < Window_Command
alias falcao_addnew_command add_original_commands
def add_original_commands
add_command('Resolution', :reso, main_commands_enabled)
falcao_addnew_command
end
end
class Scene_Menu < Scene_MenuBase
alias falcao_reso_command create_command_window
def create_command_window
falcao_reso_command
@command_window.set_handler(:reso, method(:resolution_window))
end
def resolution_window
@commands_reso = Window_ResoCommand.new
@commands_reso.set_handler(:normal, method(:reso_selection))
@commands_reso.set_handler(:full, method(:reso_selection))
@commands_reso.set_handler(:cancel, method(:cancelar))
end
def reso_selection
case @commands_reso.current_symbol
when :normal
if $game_resolution == 1
$game_resolution = 0
make_resolution
else
cancelar ; return
end
@commands_reso.activate
when :full
if $game_resolution == 0
$game_resolution = 1
make_resolution
else
cancelar ; return
end
@commands_reso.activate
end
end
def make_resolution
FalRes.resolution
FalRes.write_decision
end
def cancelar
@commands_reso.dispose
@commands_reso = nil
@command_window.activate
end
end
class Window_ResoCommand < Window_Command
def initialize
super(164, 130)
self.openness = 0
open
end
def window_width
return 180
end
def make_command_list
add_command('Normal 544x416', :normal)
add_command('Full Screen ', :full)
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1