HUNTERSáb Ene 19, 2013 11:09 pm
Super Usuario
SELECCION DE RESOLUCION DE PANTALA
INTRODUCCION:
Añade una opción de configuración en la pantalla de título que permite cambios en la resolución.
IMAGENES DE MUESTRA:
CREDITOS:
Skyllander
SCRIPT:
- Código:
#==============================================================================
# Seleção de Resolução na Tela Inicial
# Autor: Skyllander
#------------------------------------------------------------------------------
# Opção de configuração adicionada no menu da Scene_Title para que possa ser
# realizada a troca da resolução do jogo. Suporta apenas as resoluções
# "default" do Maker.
#==============================================================================
# Modificação da Scene_Title e sua Window para inserção da opção.
#==============================================================================
class Window_TitleCommand < Window_Command
def make_command_list
add_command(Vocab::new_game, :new_game)
add_command(Vocab::continue, :continue, continue_enabled)
add_command('Configurações', :config)
add_command(Vocab::shutdown, :shutdown)
end
end
class Scene_Title < Scene_Base
def create_command_window
@command_window = Window_TitleCommand.new
@command_window.set_handler(:new_game, method(:command_new_game))
@command_window.set_handler(:continue, method(:command_continue))
@command_window.set_handler(:config, method(:command_config))
@command_window.set_handler(:shutdown, method(:command_shutdown))
end
def command_config
SceneManager.call(Scene_Select)
end
end
#==============================================================================
# Criação da Window e Scene de seleção da opção de configuração. Mais opções
# podem ser inseridas aqui.
#==============================================================================
class Scene_Select < Scene_MenuBase
def start
super
create_command_window
end
def create_command_window
@command_window = Window_SelectCommand.new
@command_window.set_handler(:res, method(:command_res))
end
def command_res
SceneManager.call(Scene_Config)
end
def update
super
if Input.trigger?(:B)
Sound.play_cancel
SceneManager.return
end
end
end
class Window_SelectCommand < Window_Command
def initialize
super(Graphics.width/2.5, Graphics.height/2.5)
end
def make_command_list
add_command('Resolução', :res)
end
def window_width
120
end
end
#==============================================================================
# Criação da Window e Scene de seleção da resolução.
#==============================================================================
class Scene_Config < Scene_MenuBase
def start
super
create_message_window
create_command_window
end
def create_command_window
@command_window = Window_ConfigCommand.new
@command_window.set_handler(:res1, method(:command_res1))
@command_window.set_handler(:res2, method(:command_res2))
@command_window.set_handler(:res3, method(:command_res3))
end
def create_message_window
x = Graphics.width
y = Graphics.height
xg = Graphics.width/2.5 - 15
yg = (Graphics.height/2.5) - 56
@message_window = Window_Base.new(xg, yg, 155, 48)
@message_window.contents.draw_text(0,0,155,28,"Atual:#{x}x#{y}")
end
def command_res1
if Graphics.width != 640 or Graphics.height != 480
Graphics.fadeout(30)
Graphics.resize_screen(640 , 480)
end
2.times do
SceneManager.return
end
end
def command_res2
if Graphics.width != 640 or Graphics.height != 416
Graphics.fadeout(30)
Graphics.resize_screen(640 , 416)
end
2.times do
SceneManager.return
end
end
def command_res3
if Graphics.width != 544 or Graphics.height != 416
Graphics.fadeout(30)
Graphics.resize_screen(544 , 416)
end
2.times do
SceneManager.return
end
end
def update
super
if Input.trigger?(:B)
Sound.play_cancel
SceneManager.return
end
end
end
class Window_ConfigCommand < Window_Command
def initialize
super((Graphics.width/2.5)+10, Graphics.height/2.5)
end
def make_command_list
add_command('640x480', :res1)
add_command('640x416', :res2)
add_command('544x416', :res3)
end
def window_width
110
end
end
Eso es todo saludos.