Últimos temas
» Script de menupor maxi Jue 04 Dic 2014, 1:44 pm
» Ayuda intro animado!!!
por maxi Miér 03 Dic 2014, 9:41 pm
» ayuda con este engin
por maxi Miér 03 Dic 2014, 8:42 am
» Hud de Vida 100% Personalizable - Engine Sencillo! Sin Scripts :)
por davidaikago Jue 20 Nov 2014, 10:58 am
» Ultimate parallax control by:GDS [ace]
por arellano Miér 08 Oct 2014, 8:28 pm
» Script Touhou (animated) Map name (v1.4)
por davidaikago Miér 08 Oct 2014, 2:09 pm
» tutorial puerta nueva
por davidaikago Miér 08 Oct 2014, 9:08 am
» cámara de fotos
por davidaikago Miér 08 Oct 2014, 9:05 am
» Imperial Action System II Demo
por davidaikago Miér 08 Oct 2014, 8:47 am
» VE Batalla animada [ACE]
por FhierusIV Jue 18 Sep 2014, 10:57 am
» Nuevo Reglamento del Foro [Vigente desde Septiembre 2014]
por maxi Miér 17 Sep 2014, 8:37 am
» MOG|Animated Title
por Souta21 Mar 09 Sep 2014, 7:24 pm
» Tutorial Engine - Cambiar Character al Equipar Objeto
por maxi Lun 21 Jul 2014, 10:19 am
» Script de climas
por gambasoxd Sáb 19 Jul 2014, 8:58 am
» Script de contraseña(codigo) para abrir un cofre
por rpgame Jue 03 Jul 2014, 6:03 pm
¿Quién está en línea?
En total hay 1 usuario en línea: 0 Registrados, 0 Ocultos y 1 Invitado Ninguno
El record de usuarios en línea fue de 117 durante el Mar 09 Ago 2011, 3:39 pm
Script de HUD tipo Kindom hearts
5 participantes
RPG maker VX :: Scripts ::
Página 1 de 1.
Script de HUD tipo Kindom hearts
script de HUD estilo Kindom Hearts:
Introducción:
Esta es una muy bonita HUD que será visible cuando en sus mapas.
Es Plug'n'Play, no necesita configuración, pero también es
personalizable con respecto a casi todos aquellos que quieran hacerla
suya. Usted puede cambiar el diseño, todas las imágenes, las fuentes,
colores, posición, estilo de desplazamiento, y casi cualquier cosa que
usted se pueda imaginar. Menciono todo esto porque era un dolor en el
cu** , así que mejor agradezco wink.gif.
Las capturas de pantalla hablan por sí mismos, por lo que sólo se ejecutará en las características básicas:
-> Plug'n'Play, pero también muy personalizable.
-> Todos los parámetros de HUD puede ser cambiado en el juego en tiempo de ejecución.
-> Profesional apariencia (gracias Celianna).
-> Ocultar automáticamente la característica permite al jugador
para ocultar el HUD pulsando un botón. Se trata de una secuencia
animada.
-> No causa ningún retraso en sus juegos.
-> Grandes para los scripts de ABS.
Demo:
Configuración / Uso
Simplemente pegue la secuencia de comandos en una ranura vacía en
su sección "Materiales". Todas las direcciones están en la sección de
configuración del script. Usted tendrá que descargar las imágenes a
continuación y descomprimir ellos en la carpeta Graphics \ Pictures.
También he incluido las fuentes que uso en caso de que quiera de ellos
también.Link de Imagenes:http://www.megaupload.com/?d=EG01SJ8J
Screenshots:
script:
Introducción:
Esta es una muy bonita HUD que será visible cuando en sus mapas.
Es Plug'n'Play, no necesita configuración, pero también es
personalizable con respecto a casi todos aquellos que quieran hacerla
suya. Usted puede cambiar el diseño, todas las imágenes, las fuentes,
colores, posición, estilo de desplazamiento, y casi cualquier cosa que
usted se pueda imaginar. Menciono todo esto porque era un dolor en el
cu** , así que mejor agradezco wink.gif.
Las capturas de pantalla hablan por sí mismos, por lo que sólo se ejecutará en las características básicas:
-> Plug'n'Play, pero también muy personalizable.
-> Todos los parámetros de HUD puede ser cambiado en el juego en tiempo de ejecución.
-> Profesional apariencia (gracias Celianna).
-> Ocultar automáticamente la característica permite al jugador
para ocultar el HUD pulsando un botón. Se trata de una secuencia
animada.
-> No causa ningún retraso en sus juegos.
-> Grandes para los scripts de ABS.
Demo:
- Spoiler:
- Demo HUD Kindom Heart.exe
Configuración / Uso
Simplemente pegue la secuencia de comandos en una ranura vacía en
su sección "Materiales". Todas las direcciones están en la sección de
configuración del script. Usted tendrá que descargar las imágenes a
continuación y descomprimir ellos en la carpeta Graphics \ Pictures.
También he incluido las fuentes que uso en caso de que quiera de ellos
también.Link de Imagenes:http://www.megaupload.com/?d=EG01SJ8J
Screenshots:
- Spoiler:
- [Tienes que estar registrado y conectado para ver esa imagen]
script:
- Spoiler:
- #--------------------------------------------------------------------
# A list of colors that you may use to configure the font and gauge
# colors in the config section. Simply replace the last part of each
# statement, i.e., the part in the brackets <> below:
#
# Colors::
#--------------------------------------------------------------------
# Continue below for the configuration section
#--------------------------------------------------------------------
module Colors
AliceBlue = Color.new(240,248,255)
AntiquaWhite = Color.new(250,235,215)
Aqua = Color.new(0,255,255)
Aquamarine = Color.new(127,255,212)
Azure = Color.new(240,255,255)
Beige = Color.new(245,245,220)
Bisque = Color.new(255,228,196)
Black = Color.new(0,0,0)
BlanchedAlmond = Color.new(255,255,205)
Blue = Color.new(0,0,255)
BlueViolet = Color.new(138,43,226)
Brown = Color.new(165,42,42)
BurlyWood = Color.new(222,184,135)
CadetBlue = Color.new(95,158,160)
Chartreuse = Color.new(127,255,0)
Chocolate = Color.new(210,105,30)
Coral = Color.new(255,127,80)
CornFlowerBlue = Color.new(100,149,237)
Cornsilk = Color.new(255,248,220)
Crimson = Color.new(220,20,60)
Cyan = Color.new(0,255,255)
DarkBlue = Color.new(0,0,139)
DarkCyan = Color.new(0,139,139)
DarkGoldenrod = Color.new(184,134,11)
DarkGray = Color.new(169,169,169)
DarkGreen = Color.new(0,100,0)
DarkKhaki= Color.new(189,183,107)
DarkMagenta = Color.new(139,0,139)
DarkOliveGreen = Color.new(85,107,47)
DarkOrange = Color.new(255,140,0)
DarkRed = Color.new(139,0,0)
DarkSalmon = Color.new(233,150,122)
DarkSeaGreen = Color.new(143,188,143)
DarkSlateBlue = Color.new(72,61,139)
DarkSlateGray = Color.new(40,79,79)
DarkTurquoise = Color.new(0,206,209)
DarkViolet = Color.new(148,0,211)
DeepPink = Color.new(255,20,147)
DeepSkyBlue = Color.new(0,191,255)
DimGray = Color.new(105,105,105)
DodgerBlue = Color.new(30,144,255)
FireBrick = Color.new(178,34,34)
FloralWhite = Color.new(255,255,240)
ForestGreen = Color.new(34,139,34)
Fuschia = Color.new(255,0,255)
Gainsboro = Color.new(220,220,220)
GhostWhite = Color.new(248,248,255)
Gold = Color.new(255,215,0)
Goldenrod = Color.new(218,165,32)
Gray = Color.new(128,128,128)
Green = Color.new(0,128,0)
GreenYellow = Color.new(173,255,47)
Honeydew = Color.new(240,255,240)
HotPink = Color.new(255,105,180)
IndianRed = Color.new(205,92,92)
Indigo = Color.new(75,0,130)
Ivory = Color.new(255,240,240)
Khaki = Color.new(240,230,140)
Lavender = Color.new(230,230,250)
LavenderBlush = Color.new(255,240,245)
LawnGreen = Color.new(124,252,0)
LemonChiffon = Color.new(255,250,205)
LightBlue = Color.new(173,216,230)
LightCoral = Color.new(240,128,128)
LightCyan = Color.new(224,255,255)
LightGoldenrodYellow = Color.new(250,250,210)
LightGreen = Color.new(144,238,144)
LightGray = Color.new(211,211,211)
LightPink = Color.new(255,182,193)
LightSalmon = Color.new(255,160,122)
LightSeaGreen = Color.new(32,178,170)
LightSkyBlue = Color.new(135,206,250)
LightSlateGray = Color.new(119,136,153)
LightSteelBlue = Color.new(176,196,222)
LightYellow = Color.new(255,255,224)
Lime = Color.new(0,255,0)
LimeGreen = Color.new(50,205,50)
Linen = Color.new(250,240,230)
Magenta = Color.new(255,0,255)
Maroon = Color.new(128,0,0)
MediumAquamarine = Color.new(102,205,170)
MediumBlue = Color.new(0,0,205)
MediumOrchid = Color.new(186,85,211)
MediumPurple = Color.new(147,112,219)
MediumSeaGreen = Color.new(60,179,113)
MediumSlateBlue = Color.new(123,104,238)
MediumSpringGreen = Color.new(0,250,154)
MediumTurquoise = Color.new(72,209,204)
MediumVioletRed = Color.new(199,21,112)
MidnightBlue = Color.new(25,25,112)
MintCream = Color.new(245,255,250)
MistyRose = Color.new(255,228,225)
Moccasin = Color.new(255,228,181)
NavajoWhite = Color.new(255,222,173)
Navy = Color.new(0,0,128)
OldLace = Color.new(253,245,230)
Olive = Color.new(128,128,0)
OliveDrab = Color.new(107,142,45)
Orange = Color.new(255,165,0)
OrangeRed = Color.new(255,69,0)
Orchid = Color.new(218,112,214)
PaleGoldenRod = Color.new(238,232,170)
PaleGreen = Color.new(152,251,152)
PaleTurquoise = Color.new(175,238,238)
PaleVioletRed = Color.new(219,112,147)
PapayaWhip = Color.new(255,239,213)
PeachPuff = Color.new(255,218,155)
Peru = Color.new(205,133,63)
Pink = Color.new(255,192,203)
Plum = Color.new(221,160,221)
PowderBlue = Color.new(176,224,230)
Purple = Color.new(128,0,128)
Red = Color.new(255,0,0)
RosyBrown = Color.new(188,143,143)
RoyalBlue = Color.new(65,105,225)
SaddleBrown = Color.new(139,69,19)
Salmon = Color.new(250,128,114)
SandyBrown = Color.new(244,164,96)
SeaGreen = Color.new(46,139,87)
Seashell = Color.new(255,245,238)
Sienna = Color.new(160,82,45)
Silver = Color.new(192,192,192)
SkyBlue = Color.new(135,206,235)
SlateBlue = Color.new(106,90,205)
SlateGray = Color.new(112,128,144)
Snow = Color.new(255,250,250)
SpringGreen = Color.new(0,255,127)
SteelBlue = Color.new(70,130,180)
Tan = Color.new(210,180,140)
Teal = Color.new(0,128,128)
Thistle = Color.new(216,191,216)
Tomato = Color.new(253,99,71)
Turquoise = Color.new(64,244,208)
Violet = Color.new(238,130,238)
Wheat = Color.new(245,222,179)
White = Color.new(255,255,255)
WhiteSmoke = Color.new(245,245,245)
Yellow = Color.new(255,255,0)
YellowGreen = Color.new(154,205,50)
GaugeGreen = Color.new(202,241,126)
GaugeBlue = Color.new(137,222,254)
end
#--------------------------------------------------------------------
# do not touch this
class Point
attr_reader [Tienes que estar registrado y conectado para ver esa imagen]
attr_reader :y
def initialize(x, y)
@x, @y = x, y
end
def to_a
[@x, @y]
end
end
# or this
class ScrollDirection
Left = 0
Right = 1
end
#--------------------------------------------------------------------
#--------------------------------------------------------------------
# * Configuration Section
#--------------------------------------------------------------------
# * Aside from these settings, you can also force the HUD to hide
# by using the "script..." event command with this text:
#
# $scene.hide_hud
#--------------------------------------------------------------------
module HudConfig
# The actor id of the main character in your game.
# This will be the character in the main hud window.
PLAYER_ID = 1
# Name of the player (main character) hud graphic
PLAYER_HUD_IMAGE_NAME = 'player_hud'
# Use the gren and blue mp/hp gauges?
# You may use your own graphics, but they must
# adhere to the same format as the originals, i.e.,
#
# hud_bar_hp_000.png
#
# Where the '000' part is a multiple of five, from 0-100.
PLAYER_USE_CUSTOM_GAUGE = true
# The physical location of the hud sprite.
# All of the other graphic locations are relative to this one.
PLAYER_HUD_LOC = Point.new(0, 0)
# The relative location of the hud image to the hud sprite.
PLAYER_HUD_IMAGE_LOCATION = Point.new(0, 0)
# The starting location of each peice of the HP gauge.
PLAYER_HP_GAUGE_LOCATION = Point.new(0, 0)
# the starting location of each peice of the MP gauge.
PLAYER_MP_GAUGE_LOCATION = Point.new(0, 0)
SHOW_PLAYER_FACE_IMAGE = true
# The location of the face graphic.
FACE_LOCATION = Point.new(35, 0)
# Show all party members? (THESE FEATURES ARE NOT YET IMPLEMENTED)
USE_MEMBER_WINDOW = true
MEMBER_HUD_IMAGE_NAME = 'member_hud'
MEMBER_USE_CUSTOM_GAUGE = false
# Allow the player to hide the HUD by pressing a button?
ALLOW_HUD_HIDE = true
# The button which will trigger a hud move.
HIDE_HUD_INPUT = Input::X
# The speed at which to move the hud.
HUD_HIDE_SPEED = 7
# replace "Left" with "Right" below to change the scroll direction
HUD_SCROLL_DIRECTION = ScrollDirection::Left
# Global values which are convenient for setting
# multiple values to the same thing.
GLOBAL_FONT_NAME = ['Magneto', 'Consolas', 'Verdana', 'Ariel', 'Courier New']
GLOBAL_PLAYER_FONT_SIZE = 22
GLOBAL_MEMBER_FONT_SIZE = 22
SHOW_PLAYER_NAME = true
# The rest of the settings deal with setting the
# location and style of the text displayed in the HDU
PLAYER_NAME_FONT = GLOBAL_FONT_NAME
PLAYER_NAME_COLOR = Colors::Silver
PLAYER_NAME_USE_ITALICS = false
PLAYER_NAME_USE_BOLD = false
PLAYER_NAME_USE_SHADOW = true
PLAYER_NAME_FONT_SIZE = 20
PLAYER_NAME_LOCATION = Point.new(125,0)
PLAYER_NAME_WIDTH = 90
PLAYER_NAME_HEIGHT = 22
MEMBER_NAME_FONT = GLOBAL_FONT_NAME
MEMBER_NAME_COLOR = Colors::White
MEMBER_NAME_FONT_SIZE = GLOBAL_MEMBER_FONT_SIZE
MEMBER_NAME_LOCATION = Point.new(0,0)
USE_HP_TEXT_DISPLAY = true
PLAYER_HP_FONT = ['Consolas', 'Verdana', 'Ariel', 'Courier New']
PLAYER_FULL_HP_COLOR = Colors::GaugeGreen
PLAYER_HP_FONT_USE_ITALICS = false
PLAYER_HP_FONT_USE_BOLD = true
PLAYER_HP_FONT_USE_SHADOW = true
PLAYER_HP_FONT_SIZE = 14
PLAYER_HP_LOCATION = Point.new(130,66)
PLAYER_HP_WIDTH = 76
PLAYER_HP_HEIGHT = 11
MEMBER_HP_FONT = GLOBAL_FONT_NAME
MEMBER_HP_FONT_SIZE = GLOBAL_MEMBER_FONT_SIZE
MEMBER_HP_LOCATION = Point.new(0,0)
USE_MP_TEXT_DISPLAY = USE_HP_TEXT_DISPLAY
PLAYER_MP_FONT = PLAYER_HP_FONT
PLAYER_FULL_MP_COLOR = Colors::GaugeBlue
PLAYER_MP_FONT_USE_ITALICS = PLAYER_HP_FONT_USE_ITALICS
PLAYER_MP_FONT_USE_BOLD = PLAYER_HP_FONT_USE_BOLD
PLAYER_MP_FONT_USE_SHADOW = PLAYER_HP_FONT_USE_SHADOW
PLAYER_MP_FONT_SIZE = PLAYER_HP_FONT_SIZE
PLAYER_MP_LOCATION = Point.new(PLAYER_HP_LOCATION.x, PLAYER_HP_LOCATION.y + PLAYER_HP_HEIGHT + 1)
PLAYER_MP_WIDTH = PLAYER_HP_WIDTH
PLAYER_MP_HEIGHT = PLAYER_HP_HEIGHT
MEMBER_MP_FONT = GLOBAL_FONT_NAME
MEMBER_MP_FONT_SIZE = GLOBAL_MEMBER_FONT_SIZE
MEMBER_MP_LOCATION = Point.new(0,0)
SHOW_PLAYER_LEVEL = true
PLAYER_LEVEL_FONT = GLOBAL_FONT_NAME
PLAYER_LEVEL_COLOR = Colors::Gold
PLAYER_LEVEL_USE_ITALICS = false
PLAYER_LEVEL_USE_BOLD = false
PLAYER_LEVEL_USE_SHADOW = true
PLAYER_LEVEL_FONT_SIZE = 18
PLAYER_LEVEL_LOCATION = Point.new(136,24)
PLAYER_LEVEL_WIDTH = 36
PLAYER_LEVEL_HEIGHT = 35
MEMBER_LEVEL_FONT = GLOBAL_FONT_NAME
MEMBER_LEVEL_COLOR = PLAYER_LEVEL_COLOR
MEMBER_LEVEL_FONT_SIZE = 10
MEMBER_LEVEL_LOCATION = Point.new(0,0)
#-------
# don't change the values below unless you know what you are doing.
# Shows above the map and below the message window by default
PLAYER_HUD_Z = 199
# The text format used for gauage images.
HEALTH_GAUGE_FORMAT = 'hud_bar_%s_%.3d'
# the name of the image file used as a mask for the face graphic
PLAYER_FACE_MASK_NAME = 'player_face_mask'
end
class EventHandler
def initialize
@client_map = {}
end
def add_listener(id, func)
(@client_map[id.hash] ||= []) << func
end
def remove_listener(id)
return @client_map.delete(id.hash)
end
def alert_listeners(*args)
@client_map.each_value { |v| v.each { |func| func.call(*args) } }
end
def dispose
@client_map = nil
end
end
class Game_Actor < Game_Battler
attr_reader :hp_changed
attr_reader :mp_changed
attr_reader :maxhp_changed
attr_reader :maxmp_changed
alias :pre_confhud_ga_init :initialize unless $@
def initialize(*args)
@hp_changed = EventHandler.new
@mp_changed = EventHandler.new
@maxhp_changed = EventHandler.new
@maxmp_changed = EventHandler.new
pre_confhud_ga_init(*args)
end
def on_hp_changed(*args)
@hp_changed.alert_listeners(*args)
end
def on_mp_changed(*args)
@mp_changed.alert_listeners(*args)
end
def on_maxhp_changed(*args)
@maxhp_changed.alert_listeners(*args)
end
def on_maxmp_changed(*args)
@maxmp_changed.alert_listeners(*args)
end
alias :pre_confhud_ga_hpequ :hp= unless $@
def hp=(*args)
temp = @hp
pre_confhud_ga_hpequ(*args)
on_hp_changed(@hp) unless temp == @hp
end
alias :pre_confhud_ga_maxhpequ :maxhp= unless $@
def maxhp=(*args)
temp = self.maxhp
pre_confhud_ga_maxhpequ(*args)
cur_max = self.maxhp
on_maxhp_changed(cur_max) unless temp == cur_max
end
alias :pre_confhud_ga_mpequ :mp= unless $@
def mp=(*args)
temp = @mp
pre_confhud_ga_mpequ(*args)
on_mp_changed(@mp) unless temp == @mp
end
alias :pre_confhud_ga_maxmpequ :maxmp= unless $@
def maxmp=(*args)
temp = self.maxmp
pre_confhud_ga_maxmpequ(*args)
cur_max = self.maxmp
on_maxmp_changed(cur_max) unless temp == cur_max
end
alias :pre_confhud_ga_recover_all :recover_all unless $@
def recover_all(*args)
temp_hp, temp_mp = @hp, @mp
pre_confhud_ga_recover_all(*args)
on_hp_changed if temp_hp != @hp
on_mp_changed if temp_mp != @mp
end
end
class Game_Party
attr_reader :party_leader_changed
alias :pre_confhud_gp_init :initialize
def initialize(*args)
pre_confhud_gp_init(*args)
@party_leader_changed = EventHandler.new
end
def on_party_leader_changed(*args)
party_leader_changed.alert_listeners(*args)
end
alias :pre_confhud_gp_add_actor :add_actor
def add_actor(*args)
leader = $game_party.members.first
pre_confhud_gp_add_actor(*args)
on_party_leader_changed unless leader == $game_party.members.first
end
alias :pre_confhud_gp_remove_actor :remove_actor
def remove_actor(*args)
leader = $game_party.members.first
pre_confhud_gp_remove_actor(*args)
on_party_leader_changed unless leader == $game_party.members.first
end
end
class Window_Base < Window
alias :pre_confhud_wb_hp_color :hp_color unless $@
def hp_color(actor, for_hud=false)
return HudConfig::PLAYER_FULL_HP_COLOR if for_hud && actor.hp == actor.maxhp
return pre_confhud_wb_hp_color(actor)
end
alias :pre_confhud_wb_mp_color :mp_color unless $@
def mp_color(actor, for_hud=false)
return HudConfig::PLAYER_FULL_MP_COLOR if for_hud && actor.mp == actor.maxmp
return pre_confhud_wb_mp_color(actor)
end
end
class MainHud < Sprite_Base
include HudConfig
WLH = Window_Base::WLH
attr_accessor :actor
def initialize(location, viewport=nil, actor=nil)
super(viewport)
self.bitmap = Bitmap.new(Graphics.width, Graphics.height)
self.x, self.y = location.x, location.y
self.actor = actor
end
def actor=(value)
# allow nil values to cause a refresh so that the hud
# is painted at all times, even when there are no party members.
return if @actor == value unless value.nil?
remove_listeners(@actor)
add_listeners(value)
@actor = value
create_player_face_image
refresh
end
def image_rect
ret = hud_image.rect
ret.x, ret.y = *PLAYER_HUD_LOC.to_a
return ret
end
def create_dummy_window
win = Window_Base.new(0, 0, 64, 64)
win.visible = false
return win
end
def hp_color
return (@window ||= create_dummy_window).hp_color(@actor, true)
end
def mp_color
return (@window ||= create_dummy_window).mp_color(@actor, true)
end
def hud_image
return Cache.picture(PLAYER_HUD_IMAGE_NAME)
end
def hud_location
return PLAYER_HUD_IMAGE_LOCATION
end
def hp_gauge_location
return PLAYER_HP_GAUGE_LOCATION
end
def mp_gauge_location
return PLAYER_MP_GAUGE_LOCATION
end
def name_draw_rect
return Rect.new(
PLAYER_NAME_LOCATION.x,
PLAYER_NAME_LOCATION.y,
PLAYER_NAME_WIDTH,
PLAYER_NAME_HEIGHT
)
end
def level_draw_rect
return Rect.new(
PLAYER_LEVEL_LOCATION.x,
PLAYER_LEVEL_LOCATION.y,
PLAYER_LEVEL_WIDTH,
PLAYER_LEVEL_HEIGHT
)
end
def hp_draw_rect
return Rect.new(
PLAYER_HP_LOCATION.x,
PLAYER_HP_LOCATION.y,
PLAYER_HP_WIDTH,
PLAYER_HP_HEIGHT
)
end
def mp_draw_rect
return Rect.new(
PLAYER_MP_LOCATION.x,
PLAYER_MP_LOCATION.y,
PLAYER_MP_WIDTH,
PLAYER_MP_HEIGHT
)
end
def name_font
font = Font.new(PLAYER_NAME_FONT, PLAYER_NAME_FONT_SIZE)
font.color = PLAYER_NAME_COLOR
font.italic = PLAYER_NAME_USE_ITALICS
font.bold = PLAYER_NAME_USE_BOLD
font.shadow = PLAYER_NAME_USE_SHADOW
return font
end
def hp_font
font = Font.new(PLAYER_HP_FONT, PLAYER_HP_FONT_SIZE)
font.color = hp_color
font.italic = PLAYER_HP_FONT_USE_ITALICS
font.bold = PLAYER_HP_FONT_USE_BOLD
font.shadow = PLAYER_HP_FONT_USE_SHADOW
return font
end
def mp_font
font = Font.new(PLAYER_MP_FONT, PLAYER_MP_FONT_SIZE)
font.color = mp_color
font.italic = PLAYER_MP_FONT_USE_ITALICS
font.bold = PLAYER_MP_FONT_USE_BOLD
font.shadow = PLAYER_MP_FONT_USE_SHADOW
return font
end
def level_font
font = Font.new(PLAYER_LEVEL_FONT, PLAYER_LEVEL_FONT_SIZE)
font.color = PLAYER_LEVEL_COLOR
font.italic = PLAYER_LEVEL_USE_ITALICS
font.bold = PLAYER_LEVEL_USE_BOLD
font.shadow = PLAYER_LEVEL_USE_SHADOW
return font
end
def player_face_mask_image
return Cache.picture(PLAYER_FACE_MASK_NAME)
end
def create_player_face_image(size=96)
if @actor.nil?
@face_image = Bitmap.new(size, size)
return
end
face = Cache.face(@actor.face_name)
rect = Rect.new(0, 0, 0, 0)
rect.x = @actor.face_index % 4 * 96 + (96 - size) / 2
rect.y = @actor.face_index / 4 * 96 + (96 - size) / 2
rect.width = size
rect.height = size
mask = player_face_mask_image
@face_image = Bitmap.new(rect.width, rect.height)
@face_image.blt(0, 0, face, rect)
for y in 0...rect.height
for x in 0...rect.width
mask_color = mask.get_pixel(x, y)
@face_image.set_pixel(x, y, mask_color) if mask_color.alpha == 0
end
end
end
def add_listeners(actor)
return if actor.nil?
func = lambda { refresh }
actor.hp_changed.add_listener(self, func)
actor.maxhp_changed.add_listener(self, func)
actor.mp_changed.add_listener(self, func)
actor.maxmp_changed.add_listener(self, func)
end
def remove_listeners(actor)
return if actor.nil?
actor.hp_changed.remove_listener(self)
actor.maxhp_changed.remove_listener(self)
actor.mp_changed.remove_listener(self)
actor.maxmp_changed.remove_listener(self)
end
def draw_hud
draw_custom_mp_gauge
draw_custom_hp_gauge
image = hud_image
location = hud_location
self.bitmap.blt(location.x, location.y, image, image.rect)
end
def draw_custom_hp_gauge
cur, max = *(@actor.nil? ? [0,1] : [@actor.hp,@actor.maxhp])
draw_gauge(hp_gauge_location, 'hp', cur, max)
end
def draw_custom_mp_gauge
cur, max = *(@actor.nil? ? [0,1] : [@actor.mp,@actor.maxmp])
draw_gauge(mp_gauge_location, 'mp', cur, max)
end
def draw_gauge(location, stat_name, current, max)
percent_health = (current / max.to_f) * 100
multiple = 5
percent_health = check_health_bounds(percent_health, multiple)
percent_health = round_to_multiple_of(multiple, percent_health.round)
file_name = HEALTH_GAUGE_FORMAT % [stat_name, percent_health]
image = Cache.picture(file_name)
self.bitmap.blt(location.x, location.y, image, image.rect)
end
def round_to_multiple_of(multiple_of, num)
leftover = num % multiple_of
return num if leftover.zero?
if leftover > multiple_of / 2
sym = :+
else
sym = :-
end
ret = num
loop do
ret = ret.send sym, 1
break if ret % multiple_of == 0
end
return ret
end
def check_health_bounds(num, multiple)
# dont allow the gauge to read 100 or 0 unless
# the current health actually is 100 or 0.
next_lower = 100 - multiple
if num > next_lower && num < 100
return next_lower
elsif num < multiple && num > 0
return multiple
else
return num
end
end
def draw_face
self.bitmap.blt(FACE_LOCATION.x, FACE_LOCATION.y, @face_image, @face_image.rect)
end
def draw_name
return if @actor.nil?
name = @actor.name
rect = name_draw_rect
font = name_font
temp_font = self.bitmap.font
self.bitmap.font = font
self.bitmap.draw_text(rect, name)
self.bitmap.font = temp_font
end
def draw_level
return if @actor.nil?
level = @actor.level
rect = level_draw_rect
font = level_font
temp_font = self.bitmap.font
self.bitmap.font = font
self.bitmap.draw_text(rect, level, 1)
self.bitmap.font = temp_font
end
def use_custom_gauges?
return PLAYER_USE_CUSTOM_GAUGE
end
def health_text(prefix, cur, max)
return "#{prefix}: #{cur}/#{max}"
end
def draw_health(rect, font, prefix, cur, max)
self.bitmap.font = font
xr = rect.x + rect.width
health_width = (rect.width * 0.33).round
spacer_width = (health_width / 2.1).round
temp_font = self.bitmap.font
prefixf = prefix + ':'
# fuck this pile of shit, move along, this will just hurt your head
self.bitmap.draw_text(rect.x, rect.y, self.bitmap.text_size(prefixf).width, rect.height, prefixf)
self.bitmap.draw_text(xr - spacer_width - health_width * 2 + (health_width * 0.15).round, rect.y, health_width, rect.height, cur, 2)
self.bitmap.draw_text(xr - spacer_width - health_width, rect.y, spacer_width, rect.height, "/", 2)
self.bitmap.draw_text(xr - health_width, rect.y, health_width, rect.height, max, 2)
self.bitmap.font = temp_font
end
def draw_hp
return if @actor.nil?
draw_health(hp_draw_rect, hp_font, Vocab.hp_a, @actor.hp, @actor.maxhp)
end
def draw_mp
return if @actor.nil?
draw_health(mp_draw_rect, mp_font, Vocab.mp_a, @actor.mp, @actor.maxmp)
end
def refresh
self.bitmap.clear
draw_face if SHOW_PLAYER_FACE_IMAGE
draw_hud
draw_name if SHOW_PLAYER_NAME
draw_level if SHOW_PLAYER_LEVEL
draw_hp if USE_HP_TEXT_DISPLAY
draw_mp if USE_MP_TEXT_DISPLAY
end
def dispose
remove_listeners(@actor)
unless @window.nil?
@window.dispose
@window = nil
end
super
end
end
class SubHud < MainHud
end
class Scene_Map < Scene_Base
include HudConfig
attr_reader :player_hud
# used to keep track of the hud location between
# setups and teardowns, i.e., if you enter the menu or battle.
@@last_hud_ox = 0
alias :pre_confhud_sm_start :start unless $@
def start
pre_confhud_sm_start
initialize_hud
$game_party.party_leader_changed.add_listener(self, lambda { @player_hud.actor = $game_party.members.first })
end
def initialize_hud
@hud_viewport = Viewport.new(0, 0, 544, 416)
@hud_viewport.z = PLAYER_HUD_Z
@hud_viewport.ox = @@last_hud_ox
@@target_hud_location ||= @hud_viewport.ox
@player_hud = MainHud.new(PLAYER_HUD_LOC, @hud_viewport, $game_party.members.first)
end
alias :pre_confhud_sm_update :update unless $@
def update
pre_confhud_sm_update
update_hud
update_hud_input
update_hud_transition
end
alias :pre_confhud_sm_update_basic :update_basic unless $@
def update_basic(*args)
pre_confhud_sm_update_basic
update_hud
end
def hide_hud
trigger_scroll(true)
end
def trigger_scroll(force_hide=false)
@@hud_moving = true
if @hud_viewport.ox.zero?
hud_rect = @player_hud.image_rect
left = HUD_SCROLL_DIRECTION == ScrollDirection::Left
offset = left ? hud_rect.width + hud_rect.x : -(Graphics.width - hud_rect.x)
@@target_hud_location = @hud_viewport.ox + offset
elsif !force_hide
@@target_hud_location = 0
end
end
def update_hud
@hud_viewport.update
end
def update_hud_input
trigger_scroll if ALLOW_HUD_HIDE && Input.trigger?(HIDE_HUD_INPUT)
end
def update_hud_transition
@@hud_moving = @hud_viewport.ox != @@target_hud_location
return unless @@hud_moving
incr = @hud_viewport.ox < @@target_hud_location ? HUD_HIDE_SPEED : -HUD_HIDE_SPEED
@hud_viewport.ox += [incr, (@hud_viewport.ox - @@target_hud_location).abs].min
end
alias :pre_confhud_sm_terminate :terminate unless $@
def terminate
pre_confhud_sm_terminate
$game_party.party_leader_changed.remove_listener(self)
@player_hud.dispose
@@last_hud_ox = @hud_viewport.ox
end
end
dragoncob123- 15
-
27
22
45
5
Extras
Sobre mí::
Re: Script de HUD tipo Kindom hearts
Gran aporte... ¿Pero se podria hacer un poco mas pequeño el hud? (es que tan grande me quita mucha vision del juego xD
Atentamente: Celith
Atentamente: Celith
Celith- 300
-
35
330
440
46
Re: Script de HUD tipo Kindom hearts
Supongo que se puede, sin embargo, necesitarías modificar las imagenes y el script....
...me imagino, puesto que no he descargado el demo, ni las imagenes
Lo bajo en la noche y te digo mañana
...me imagino, puesto que no he descargado el demo, ni las imagenes
Lo bajo en la noche y te digo mañana
SoyCanekAdministrador -
35
709
970
111
Extras
Sobre mí::
Re: Script de HUD tipo Kindom hearts
Ok muchas gracias Canek (es que tenia pensado incluir este script de hud, el script de mini mapa (el del baul, posada, enemigo, npc...) y ademas el script de localizacion. Es decir, el hud que aparezca en la parte superior izquierda, el mapa (ya lo tengo en la superior central y el de localizacion en la superior derecha (este como es logico no se muestra siempre, si no al entrar en una nueva localizacion)
Atentamente: Celith
Atentamente: Celith
Celith- 300
-
35
330
440
46
Re: Script de HUD tipo Kindom hearts
Si kieren pongo otro aporte de otro HUD ke es mas chikito?
dragoncob123- 15
-
27
22
45
5
Extras
Sobre mí::
Re: Script de HUD tipo Kindom hearts
ya puse los nuevos HUD ay te va el link
- Spoiler:
- [Tienes que estar registrado y conectado para ver este vínculo]
dragoncob123- 15
-
27
22
45
5
Extras
Sobre mí::
Re: Script de HUD tipo Kindom hearts
Ya ví, lo único que tienes que hacer es modificar las barras del PM y PV.
aqui te pongo un ejemplo:
[Tienes que estar registrado y conectado para ver esa imagen]
Borrando la parte inferior de las barras, queda más chico el hud, sin embargo,
de la media luna que queda, deberás sacar 50 imagenes, (por barra)
que son las que trae la barra completa.
Así que si quieres eso, pues a hacer un puñi de imagenes.
aqui te pongo un ejemplo:
[Tienes que estar registrado y conectado para ver esa imagen]
Borrando la parte inferior de las barras, queda más chico el hud, sin embargo,
de la media luna que queda, deberás sacar 50 imagenes, (por barra)
que son las que trae la barra completa.
Así que si quieres eso, pues a hacer un puñi de imagenes.
SoyCanekAdministrador -
35
709
970
111
Extras
Sobre mí::
Re: Script de HUD tipo Kindom hearts
LoL... creo que es comerse mucho la cabeza xD voy a echarle un vistazo al otro HUD que puede que me ahorre el trabajo =D
Atentamente: Celith
Atentamente: Celith
Celith- 300
-
35
330
440
46
Re: Script de HUD tipo Kindom hearts
Hay esto es muy trizte espero que me puedan ayudar me causa un error el script:(
cerberuz- 15
-
32
24
41
7
Extras
Sobre mí::
Re: Script de HUD tipo Kindom hearts
al pasarlo a mi juego da error:
(este al empezar partida de cero)
Script "HUD Kingdom Heart" line 554: ArgumentError ocurred. Wrong number of argument (2 for 0).
Y en la linea en cuestion pone esto:
font = Font.new(PLAYER_NAME_FONT, PLAYER_NAME_FONT_SIZE)
(este al continuar partida)
Script "HUD Kingdom Heart" line 618: NoMethodError occurred. undefined method `add_listener´for nil:NilClass.
Espero que me puedan ayudar.
saludos
(este al empezar partida de cero)
Script "HUD Kingdom Heart" line 554: ArgumentError ocurred. Wrong number of argument (2 for 0).
Y en la linea en cuestion pone esto:
font = Font.new(PLAYER_NAME_FONT, PLAYER_NAME_FONT_SIZE)
(este al continuar partida)
Script "HUD Kingdom Heart" line 618: NoMethodError occurred. undefined method `add_listener´for nil:NilClass.
Espero que me puedan ayudar.
saludos
cjurri- 50
-
43
53
77
3
Extras
Sobre mí::
Temas similares
» Script de como un tipo video al principio esta padre se los recomiendo
» HUD estilo Kingdom Hearts
» Main Title KingDom Hearts 2|
» Script: Cambio de Clase Sencillo(CCS) V.1.0.0Mi primer script.
» titulo tipo ff
» HUD estilo Kingdom Hearts
» Main Title KingDom Hearts 2|
» Script: Cambio de Clase Sencillo(CCS) V.1.0.0Mi primer script.
» titulo tipo ff
RPG maker VX :: Scripts ::
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.