Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ~ Akian~RGSS3 ~
- # Nombre del script: AR3 ~ HUD
- # Scripter: Akian~RGSS3
- # Requiere?: -
- # Versión: 1.4
- # Historial:
- # 1.0 Comienzo y Finalización del script
- # 1.1 Añadida barra de experiencia
- # 1.2 Corregido bug de actualización del nombre del mapa
- # 1.3 Agregada más edición
- # 1.4 Rework completo + agregado de playtime. Se quitó el ícono de oro y el oro.
- # Este script permite un HUD en el mapa totalmente modificable, mostrando el
- # nombre del lider del grupo, su hp, también el nombre del mapa.
- # El script está pensado para no usar imágenes, ser sencillo y elegante, además
- # (la parte más importante) ser totalmente modificable, no se requiere
- # mucho conocimiento, solo un poco de sentido común
- #===============================================================================
- # Condiciones de uso:
- # Puedes usar libremente este script en proyectos comerciales y no comerciales
- # Los créditos son requeridos, por el trabajo, el esfuerzo, el sudor, bueno no
- # tanto por el sudor.
- # Si posteas este script en algún foro debes señalar la página oficial
- # http://akianzax.wix.com/akian-rgss3
- # También nombrar la página en los créditos si lo usas para un proyecto.
- #===============================================================================
- $imported = {} if $imported.nil?
- $imported["AR3_HUD"] = true
- module AR3_HUD
- #==============================================================================
- #
- # REGION EDITABLE
- #
- #==============================================================================
- FONT_NAME = "Comic Sans MS" # Fuente
- FONT_SIZE = 18 # Tamaño de fuente
- PLAYTIME_FONT = "Verdana" # Fuente del T.juego
- PLAYTIME_FONT_SIZE = 18 # Tamaño T.juegp
- SWITCH_ID = 6
- # Posiciones del Hud x y
- ACTOR_NAME_POSITION = [0, 0]
- ACTOR_HP_POSITION = [0, 23]
- ACTOR_EXP_POSITION = [0, 40]
- ACTOR_LEVEL_POSITION = [65, 0]
- MAP_NAME_POSITION = [-25 , -30]
- PLAYTIME_POSITION = [0 , 325]
- end
- module AR3_HUD_VOCAB
- EXP_WORD = "Exp" # Palabra para definir experiencia
- PLAYTIME_WORD = "T. Juego" # Palabra para definir playtime
- # Aquí se van a definir los colores de los números y palabras del HUD
- # Map Level n°Level Vida BarraVida1 BarraVida2
- COLORS = [27, 24, 26, 8, 2, 18,
- # MinHp y Max T.juego Exp BarraExp1 BarraExp2
- 2, 0, 31, 30, 31,
- # Nombre del actor
- 23]
- # Colores 0 = Blanco || 1 = Celeste || 2 = Rojo || 3 = Verde || 4 = Celeste(Claro)
- # 5 = Lila || 6 = Amarillo || 7 = Gris(Oscuro) || 8 = Gris || 9 = Azul
- # 10 = Rojo(Fuerte) || 11 = Verde(Fuerte) || 12 = Azul(Fuerte) || 13 = Violeta
- # 14 = Naranja || 15 = Negro || 16 = Lila(Suave) || 17 = Amarillo
- # 18 = Rojo || 19 = Negro || 20 = Marron || 21 = Marron(Claro) || 22 = Azul(Agua)
- # 23 = Celeste(Fuerte) || 24 = Verde(Claro) || 25 = Marron(Raro)
- # 26 = Violeta || 27 = Rosado || 28 = Verde(Fuerte) || 29 = Verde(Claro)
- # 30 = Violeta(Fuerte) || 31 = Violeta(Suave)
- # Esto teniendo el windowskin normal, con otros puede ser igual o no, prueben.
- #==============================================================================
- #
- # FIN DE LA REGION EDITABLE
- #
- #==============================================================================
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Class Window
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- class Window_Hud < Window_Base
- include AR3_HUD
- include AR3_HUD_VOCAB
- #--------------------------------------------------------------------------
- # ▼ Initialize
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, Graphics.width, Graphics.height)
- self.contents.font.name = FONT_NAME
- self.contents.font.size = FONT_SIZE
- self.opacity = 0
- end
- #--------------------------------------------------------------------------
- # ▼ No actualizar tono
- #--------------------------------------------------------------------------
- def update_tone
- end
- #--------------------------------------------------------------------------
- # ▼ Colores de los textos
- #--------------------------------------------------------------------------
- def normal_color; text_color(0); end; # Normal
- def system_color; text_color(16); end; # System
- def crisis_color; text_color(17); end; # Crisis
- def knockout_color; text_color(18); end; # Knock out
- def gauge_back_color; text_color(19); end; # Gauge background
- def hp_gauge_color1; text_color(COLORS[4]); end; # HP gauge 1
- def hp_gauge_color2; text_color(COLORS[5]); end; # HP gauge 2
- def actor_name_color; text_color(COLORS[11]); end; # Actor name
- def exp_gauge1; text_color(COLORS[9]); end; # Exp gauge 1
- def exp_gauge2; text_color(COLORS[10]); end; # Exp gauge 2
- def exp_vocab; text_color(COLORS[8]); end; # Exp word
- def hp_min_max; text_color(COLORS[6]); end; # Hp min and max
- def vocab_hp; text_color(COLORS[3]); end; # Vocab hp
- def level_word; text_color(COLORS[1]); end; # Level Word
- def level_num; text_color(COLORS[2]); end; # Level number
- def map_word; text_color(COLORS[0]); end; # Map word
- def playtime_word; text_color(COLORS[7]); end; # Playtime word
- #--------------------------------------------------------------------------
- # ▼ Seteando el hud
- #--------------------------------------------------------------------------
- def set_hud
- draw_actor_name($game_party.leader, ACTOR_NAME_POSITION[0], ACTOR_NAME_POSITION[1])
- draw_actor_hp($game_party.leader,ACTOR_HP_POSITION[0], ACTOR_HP_POSITION[1])
- draw_exp($game_party.leader, ACTOR_EXP_POSITION[0], ACTOR_EXP_POSITION[1])
- draw_actor_level($game_party.leader, ACTOR_LEVEL_POSITION[0], ACTOR_LEVEL_POSITION[1])
- end
- #--------------------------------------------------------------------------
- # ▼ Seteando mapa y playtime
- #--------------------------------------------------------------------------
- def set_misc
- self.contents.clear
- draw_map(MAP_NAME_POSITION[0], MAP_NAME_POSITION[1], $game_map.display_name)
- draw_playtime(PLAYTIME_POSITION[0], PLAYTIME_POSITION[1])
- end
- #--------------------------------------------------------------------------
- # ▼ Dibujando mapa
- #--------------------------------------------------------------------------
- def draw_map(x, y, text)
- self.contents.font.name = FONT_NAME
- self.contents.font.size = FONT_SIZE
- change_color(map_word)
- draw_text(x, y, Graphics.width, 100, text, 2)
- draw_icon(231, Graphics.width - (text.size * 6 + 65).to_f , y + 37)
- end
- #--------------------------------------------------------------------------
- # ▼ Dibujando playtime
- #--------------------------------------------------------------------------
- def draw_playtime(x, y)
- self.contents.font.name = PLAYTIME_FONT
- self.contents.font.size = PLAYTIME_FONT_SIZE
- change_color(playtime_word)
- draw_text(x, y, Graphics.width * 0.5, 100, $game_system.playtime_s)
- draw_text(x, y-20, Graphics.width * 0.5, 100, PLAYTIME_WORD)
- end
- #--------------------------------------------------------------------------
- # * Draw Name
- #--------------------------------------------------------------------------
- def draw_actor_name(actor, x, y, width = 112)
- change_color(actor_name_color)
- draw_text(x, y, width, line_height, actor.name)
- end
- #--------------------------------------------------------------------------
- # * Draw Level
- #--------------------------------------------------------------------------
- def draw_actor_level(actor, x, y)
- change_color(level_word)
- draw_text(x, y, 32, line_height, Vocab::level_a)
- change_color(level_num)
- draw_text(x + 10, y, 24, line_height, actor.level, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw HP
- #--------------------------------------------------------------------------
- def draw_actor_hp(actor, x, y, width = 80)
- draw_gauge(x+30, y+5, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
- change_color(vocab_hp)
- draw_text(x, y, 30, line_height, Vocab::hp_a)
- draw_current_and_max_values(x-12, y, width+40, actor.hp, actor.mhp,
- hp_min_max, hp_min_max)
- end
- #--------------------------------------------------------------------------
- # ▼ Dibujando exp gauge
- #--------------------------------------------------------------------------
- def draw_exp_gauge(x, y, width, rate, color1, color2)
- fill_w = (width * rate).to_i
- gauge_y = y + line_height - 8
- contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
- contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
- end
- #--------------------------------------------------------------------------
- # ▼ Dibujando exp gauge
- #--------------------------------------------------------------------------
- def draw_exp(actor, x, y, width = 80)
- s1 = actor.max_level? ? "---------" : actor.exp
- s2 = actor.max_level? ? "0" : actor.next_level_exp - actor.exp
- if actor.max_level? ?
- draw_exp_gauge(x+28, y+5, width, 5, exp_gauge1, exp_gauge2) :
- draw_gauge(x+28, y+5, width,((((actor.exp - actor.current_level_exp).to_f/100) / ((actor.next_level_exp.to_f - actor.current_level_exp.to_f)/100))),
- exp_gauge1, exp_gauge2)
- end
- change_color(exp_vocab)
- draw_text(x, y-35, 100, 100, EXP_WORD)
- end
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Class Scene_Map (se procesa todo lo relativo al mapa)
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- class Scene_Map < Scene_Base
- include AR3_HUD
- alias akian_hud_start_zack start
- alias akian_hud_update_zack update
- #--------------------------------------------------------------------------
- # ▼ Proceso de comienzo
- #--------------------------------------------------------------------------
- def start
- akian_hud_start_zack
- create_hud_window
- create_misc_window
- end
- #--------------------------------------------------------------------------
- # ▼ Creando hud
- #--------------------------------------------------------------------------
- def create_hud_window
- @set_hud = Window_Hud.new
- @set_hud.set_hud
- @set_hud.visible = !$game_switches[SWITCH_ID]
- end
- #--------------------------------------------------------------------------
- # ▼ Creando hud misc
- #--------------------------------------------------------------------------
- def create_misc_window
- @set_misc = Window_Hud.new
- @set_misc.set_misc
- @set_misc.visible = !$game_switches[SWITCH_ID]
- end
- #--------------------------------------------------------------------------
- # ▼ Actualizacion
- #--------------------------------------------------------------------------
- def update
- akian_hud_update_zack
- @set_misc.set_misc
- @set_hud.visible = !$game_switches[SWITCH_ID]
- @set_misc.visible = !$game_switches[SWITCH_ID]
- end
- end
- #===============================================================================
- #
- # ▼ Fin del mundo, acá se acaba todo
- # ~ Akián RGSS3 ~
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment