NEO_GABLun Oct 08, 2012 9:24 pm
Usuario Nv7
Hace tiempo que no hacia nada propio asi que aqui les traigo un menu
basado en el MOG VX- Menu Yui
AUTOR: Yo
NOMBRE: GAB_MENU_B.
INSTRUCCIONES: Estan en el script.
IMAGEN:
CODIGO:
DEMO:
http://www.mediafire.com/?h923k375nlwlk3o
Eso es todo espero sus comentarios
basado en el MOG VX- Menu Yui
AUTOR: Yo
NOMBRE: GAB_MENU_B.
INSTRUCCIONES: Estan en el script.
IMAGEN:
CODIGO:
- Código:
#==============================================================================
# GAB_MENU_B.
#==============================================================================
#~ SCRIPT CREADO POR: ~#
#~ ~#
#~---------------------<<NEO_GAB>>-----------------------~# DESCRICION:
#~-------------------------------------------------------~# Menu basado en el
#~------------------Fecha:07/10/2012---------------------~# MOG VX- Menu Yui.
#~-------------------------------------------------------~#
#~-------------------------------------------------------~#
#==============================================================================
# ** Instrucciones:
# Pegar encima de main.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# # NOTA: #
# * Para activar los comandos normales del menu # Al activar el fondo del #
# $game_system.command_shake = true # menu se utilizara el fondo #
# # o parallax del mapa #
# * Para usar las imagenes del menu # si el mapa no tiene fondo #
# $game_system.Use_layout = true # entonces tendra el fondo #
# # normal. #
# * Para usar el fondo del menu # #
# $game_system.Use_parallax = true # Condiciones de Uso: #
# # Nil #
# true = activar false = desactivar # #
#==============================================================================
# ** Configuraciones Basicas.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
module GAB_BASE
module FONTS
FONT_NAME = ["Georgia", "Verdana", "Arial", "Courier"]# Fuente.
FONT_SIZE = 20 # Tamaño de la fuente.
FONT_BOLD = false # Negrita.
FONT_ITALIC = false # Cursiva.
FONT_SHADOW = false # Sombra.
FONT_OUTLINE = true # Borde.
end
module CONFIG
# Posicion de los comandos del menu.
COMMANDS_POS = [10, 100]
# Posicion de la ventana de estado.
STATUS_POS = [170, 95]
# Posicion de la ventana de dinero.
GOLD_POS = [200, 50]
# Posicion de la ventana de tiempo.
TIME_POS = [178, 10]
# Posicion de la ventana del nombre del mapa.
NAMEMAP_POS = [0, 370]
# Utilizar el efecto SHAKE en los comandos.
COMMAND_SHAKE = true
# Utilizar el parallax del maa como fondo del menu.
USE_PARALLAX = true
# Utilizar las imagenes del menu.
USE_IMAGE_LAYOUT = true
end
end
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# ** Fin de las configuraciones.
#==============================================================================
#==============================================================================
# * Fuente del juego.
#==============================================================================
Font.default_name = GAB_BASE::FONTS::FONT_NAME
Font.default_size = GAB_BASE::FONTS::FONT_SIZE
Font.default_bold = GAB_BASE::FONTS::FONT_BOLD
Font.default_italic = GAB_BASE::FONTS::FONT_ITALIC
Font.default_shadow = GAB_BASE::FONTS::FONT_SHADOW
Font.default_outline = GAB_BASE::FONTS::FONT_OUTLINE
#==============================================================================
# ** Scene_Menu
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_MenuBase
include GAB_BASE
include CONFIG
alias gab_start start
alias gab_update update
alias gab_terminate terminate
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Start Processing.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def start
super
gab_start
create_commands
create_layout
create_time_window
create_namemap_window
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create layout.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_layout
@back1_sprite = Plane.new
@back1_sprite.bitmap = layout_bitmap
if $game_system.use_layout
@layout_sprite = Sprite.new
@layout_sprite.bitmap = Cache.system("Menu_Layout")
@layout2_sprite = Sprite.new
@layout2_sprite.bitmap = Cache.system("Menu_Layout2")
@layout2_sprite.y = 304
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Layout Bitmap.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def layout_bitmap
if $game_map.parallax_name and $game_system.use_parallax
Cache.parallax($game_map.parallax_name)
else
SceneManager.background_bitmap
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Status Window.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_status_window
@status_window = Window_MenuStatus.new(STATUS_POS[0], STATUS_POS[1])
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Gold Window.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_gold_window
@gold_window = Window_Gold.new
@gold_window.x = GOLD_POS[0]
@gold_window.y = GOLD_POS[1]
@gold_window.opacity = 0
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Time Window.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_time_window
@time_window = Window_GameTime.new(TIME_POS[0], TIME_POS[1])
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Name Map Window.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_namemap_window
@namemap_window = Window_NameMap.new(NAMEMAP_POS[0], NAMEMAP_POS[1])
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Commands.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_commands
@command_window.visible = false if $game_system.command_shake
@command_window.opacity = 0
@command_window.y = COMMANDS_POS[1]
@commands_index_old = -1
@commands = []
@commands_shake_duration = 0
index = 0
for com in @command_window.list
sprite = Sprite.new
sprite.bitmap = Cache.system(com[:name].to_s) rescue nil
if sprite.bitmap == nil
sprite.bitmap = Bitmap.new(200,32)
sprite.bitmap.font.size = 20
sprite.bitmap.font.bold = true
sprite.bitmap.font.italic = true
sprite.bitmap.draw_text(0, 0, 200, 32, com[:name].to_s)
end
sprite.x = COMMANDS_POS[0] - 100 - (index * 20)
sprite.y = index * (sprite.bitmap.height - 5) + COMMANDS_POS[1]
sprite.z = 100 + index
sprite.opacity = 100
index += 1
@commands.push(sprite)
end
@command_max = index
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update
if $game_system.command_shake
update_commands_ini
update_commands
end
@back1_sprite.ox += 1 if $game_map.parallax_name and $game_system.use_parallax
gab_update
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Commands Initial.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update_commands_ini
for i in @commands
index = 0
if i.x < COMMANDS_POS[0]
i.x += 5 + (2 * index)
i.opacity += 10
if i.x >= COMMANDS_POS[0]
i.x = COMMANDS_POS[0]
i.opacity = 255
end
end
index += 1
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Commands.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update_commands
if @commands_index_old != @command_window.index
@commands_index_old = @command_window.index
@commands_shake_duration = 30
if @flash_select != nil
@flash_select.opacity = 255
end
end
return if @commands_shake_duration == 0
@commands_shake_duration -= 1 if @commands_shake_duration > 0
@commands_shake_duration = 0 if !$game_system.command_shake
for i in @commands
if (i.z - 100) == @command_window.index
i.opacity += 10
i.x = COMMANDS_POS[0] + rand(@commands_shake_duration)
else
i.opacity -= 3 if i.opacity > 100
i.x = COMMANDS_POS[0]
end
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Terminate.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def terminate
gab_terminate
for com in @commands
com.bitmap.dispose
com.dispose
end
return if @back1_sprite == nil
@back1_sprite.bitmap.dispose
@back1_sprite.dispose
@back1_sprite == nil
return if @layout_sprite == nil
@layout_sprite.dispose
@layout_sprite.bitmap.dispose
return if @layout2_sprite == nil
@layout2_sprite.dispose
@layout2_sprite.bitmap.dispose
super
end
end
#==============================================================================
# ** Window_MenuCommand
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This command window appears on the menu screen.
#==============================================================================
class Window_Selectable < Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :list
end
#==============================================================================
# ** Window_MenuStatus
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :pending_index
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize(x, y)
super(x, y, 344, 220)
self.opacity = 0
@pending_index = -1
refresh
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Number of Columns.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def col_max
return 2
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Item Height.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def item_height
(height - standard_padding * 2) / 2
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Item.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
draw_actor_name(actor, rect.x + 3, rect.y + 2)
contents.font.size = 18
draw_actor_graphic(actor, rect.x + 115, rect.y + 52 + line_height)
draw_actor_level(actor, rect.x + 85, rect.y + 2)
draw_actor_hp(actor, rect.x + 16, rect.y + line_height * 2, 80)
draw_actor_mp(actor, rect.x + 16, rect.y + line_height * 3 - 6, 80)
draw_actor_icons(actor, rect.x + 16, rect.y + line_height + 3, 80)
contents.font.size = Font.default_size
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Actor Icons.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_actor_icons(actor, x, y, width = 72)
icons = (actor.state_icons + actor.buff_icons)
i = 0
icons.each do |icon|
ix = x+(i*24)
iy = y+(0)
draw_icon(icon, ix, iy)
i+= 1
end
end
end
#==============================================================================
# ** Window_GameTime
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This window displays the game time.
#==============================================================================
class Window_GameTime < Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize(x, y)
super(x, y, 160, 48)
self.opacity = 0
update
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Start.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def start
draw_text(40, 0, 130, line_height, $game_system.playtime_s)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Update.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def update
contents.clear
start
end
end
#==============================================================================
# ** Window_NameMap
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This window displays the map name.
#==============================================================================
class Window_NameMap < Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize(x, y)
super(x, y, 544, 48)
self.opacity = 0
draw_text(0, 4, 544, 30, "Estas en " + $game_map.display_name, 1)
end
end
#==============================================================================
# ** Window_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This is a super class of all windows within the game.
#==============================================================================
class Window_Base < Window
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw currency value.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_currency_value(value, unit, x, y, width)
cx = text_size(unit).width
draw_text(x, y, width - cx - 2, line_height, value, 1)
end
end
#==============================================================================
# ** Game_System
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This class handles system data. It saves the disable state of saving and
# menus. Instances of this class are referenced by $game_system.
#==============================================================================
class Game_System
include GAB_BASE
include CONFIG
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :command_shake
attr_accessor :use_parallax
attr_accessor :use_layout
alias gab_initialize initialize
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize
@command_shake = COMMAND_SHAKE
@use_layout = USE_IMAGE_LAYOUT
@use_parallax = USE_PARALLAX
gab_initialize
end
end
#==============================================================================
# End of File.
#==============================================================================
DEMO:
http://www.mediafire.com/?h923k375nlwlk3o
Eso es todo espero sus comentarios