Sign in to follow this  
Followers 0
Fegarur

Informaci?n en el Mapa

19 posts in this topic

Descripción:
Permite ver varias informaciones mientras se anda por el mapa. Incluye el HP, SP, EXP y Dinero. La ventana se amolda según el número de personajes del equipo.

Screen:
[SPOILER]user posted image[/SPOILER]

Recursos Necesarios:
1.- En la carpeta Pictures:
[SPOILER]HUD Graphic
user posted image
HUD Graphic1
user posted image
HUD Graphic2
user posted image
HUD Graphic3
user posted image[/SPOILER]


2.- En la carpeta Icons:
[SPOILER]HP Symbol
user posted image
SP Symbol
user posted image
EXP Symbol
user posted image
Hero
user posted image[/SPOILER]

Script:
[SPOILER]
CODE
#==============================================================================
# ** Game_Actor
# Script by MeisMe
# Graphics added by Peaches
# Icons made by Joshie666 & Axerax
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Get the current EXP
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get the next level's EXP
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end

#==============================================================================
# ** Window_HUD
#------------------------------------------------------------------------------
# This class is used to display HP, SP and Gold on the map.
#==============================================================================
class Window_HUD < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(-16, -16, 672, 150)
self.contents = Bitmap.new(width-32, height-32)
self.opacity = 0
self.contents.font.size = 14
self.contents.font.name = "Arial"
@actors = []
@old_hp = []
@old_sp = []
@old_exp = []
@old_level = []
for i in 0...$game_party.actors.size
@actors.push($game_party.actors[i])
@old_hp.push(@actors[i].hp)
@old_sp.push(@actors[i].sp)
@old_exp.push(@actors[i].now_exp)
@old_level.push(@actors[i].level)
end
@old_gold = $game_party.gold
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
#self.contents.draw_text(6, 0, 32, 14, $data_system.words.hp + "")
#self.contents.draw_text(6, 14, 32, 14, $data_system.words.sp + "")
self.contents.draw_text(6, 28, 32, 14, "")
#self.contents.draw_text(6, 42, 32, 14, $data_system.words.gold + "")
self.contents.font.color = normal_color
#Images

case @actors.size
when 1
bitmap = RPG::Cache.picture("HUD Graphic")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
when 2
bitmap = RPG::Cache.picture("HUD Graphic2")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
when 3
bitmap = RPG::Cache.picture("HUD Graphic2")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
when 4
bitmap = RPG::Cache.picture("HUD Graphic3")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 640, 500))
when 5
bitmap = RPG::Cache.picture("HUD Graphic3")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 640, 500))
end

#bitmap = RPG::Cache.picture("HUD Graphic")
#self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
bitmap = RPG::Cache.icon("HP Symbol")
self.contents.blt(3, 10, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("SP Symbol")
self.contents.blt(3, 30, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("EXP Symbol")
self.contents.blt(3, 50, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("Hero")
self.contents.blt(25, 67, bitmap, Rect.new(0, 0, 24, 24))

if $game_switches[99] == true
if $game_variables[99] == 0
self.contents.draw_text(x, y, 210, 14, $game_party.item_number[1])
elsif $game_variables[8] == 1
self.contents.draw_text(x, y, 210, 14, $game_party.item_number(2))
elsif $game_variables[8] ==2
self.contents.draw_text(x, y, 110, 14, @actors[i].name)
end
end
x = 32
for i in [email protected]
y = 6
self.contents.draw_text(x, y, 110, 14, @actors[i].name)
self.contents.draw_text(x, y, 110, 14, "Nv: #{@actors[i].level}", 2)
y += 16
draw_hp_bar(@actors[i], x, y, 112, 5)
y += 19
draw_sp_bar(@actors[i], x, y, 104, 5)
y += 19
draw_exp_bar(@actors[i], x, y, 88, 5)
y += 19
x += 130
end
x = 32
self.contents.draw_text(45, 73, 110, 14, $game_party.gold.to_s)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if @actors.size != $game_party.actors.size
@actors = []
for i in 0...$game_party.actors.size
@actors.push($game_party.actors[i])
end
refresh
return
end
for i in [email protected]
if @old_hp[i] != @actors[i].hp or
@old_sp[i] != @actors[i].sp or
@old_exp[i] != @actors[i].now_exp or
@old_level[i] != @actors[i].level or
@old_gold != $game_party.gold
refresh
@old_hp[i] = @actors[i].hp
@old_sp[i] = @actors[i].sp
@old_exp[i] = @actors[i].now_exp
@old_level[i] = @actors[i].level
@old_gold = $game_party.gold
end
end
end
#--------------------------------------------------------------------------
# * Draw HP Bar
#--------------------------------------------------------------------------
def draw_hp_bar(actor, x, y, length, thick)
width = length
height = thick
c1 = Color.new(255, 0, 0)
c2 = Color.new(155, 0, 0)
e1 = actor.hp
e2 = actor.maxhp
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
#--------------------------------------------------------------------------
# * Draw SP Bar
#--------------------------------------------------------------------------
def draw_sp_bar(actor, x, y, length, thick)
width = length
height = thick
c1 = Color.new(0, 0, 255)
c2 = Color.new(0, 0, 155)
e1 = actor.sp
e2 = actor.maxsp
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
#--------------------------------------------------------------------------
# * Draw EXP Bar
#--------------------------------------------------------------------------
def draw_exp_bar(actor, x, y, length, thick)
width = length
height = thick
c1 = Color.new(158, 208, 9)
c2 = Color.new(58, 108, 0)
e1 = actor.now_exp
e2 = actor.next_exp
if actor.next_exp == 0
e1 = 1
e2 = 1
end
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
end

#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Object Aliasing
#--------------------------------------------------------------------------
alias hud_scene_map_main main
alias hud_scene_map_update update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def main
@HUD = Window_HUD.new
@HUD.visible = $game_switches[10]
hud_scene_map_main
@HUD.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@HUD.update if @HUD.visible
@HUD.visible = $game_switches[10]
hud_scene_map_update
end
end
[/SPOILER]
Instrucciones:
1.- Coloca el script sobre Main.
2.- Pega cada imagen donde corresponda.
3.- Para editar la fuente que vas a usar, cambia "Arial" por el nombre de la fuente que quieras.

Crédito:
JoShIe-Rp-Y2K5
Prexus
Axerax

Gracias también a sephirothtds y Eis. Edited by Fegarur
0

Share this post


Link to post
Share on other sites
Muy bueno para los Action RPGs. A ver para cuando haga el mío uso este script. icon13.gif
0

Share this post


Link to post
Share on other sites
Hola, ¿Como se puede hacer para activar y desactivar el script?

Suerte.
0

Share this post


Link to post
Share on other sites
Yo tambie tengo esa duda...

Como desactivo y activo el script???
Es que no deja d eaparecerme y quiero quitarlo durante erl juego. huh.gif
0

Share this post


Link to post
Share on other sites
alguien save como se desactiva i activa? alguien que sea amable y nos responda porfavor.
que no se nos ignore.
0

Share this post


Link to post
Share on other sites
Que no se os ignore, ya... pero es que no lo se.
Si lo supiera lo habría puesto de entrada, así que no puedo ayudaros.
0

Share this post


Link to post
Share on other sites
No tranquilo no me e referido ati ni mucho menos XD solo para quien lo sepa.
0

Share this post


Link to post
Share on other sites
sinceramente me he mirado el script y deberia aparecer directamente... pero por si acaso...

con llamar script creo que debes poner esto: @HUD = Window_HUD.new

y si quieres quitarla debes poner @hud.dispose, pero procura que este activa la ventana o sino entonces dara error.
0

Share this post


Link to post
Share on other sites
me referia a que en escenas del juego no interesava que saliera ese script, e intentado desactivarlo con @hud.dispose i me da error:
error ocurrido durante la ejecucion del script nomethoderror
undefined method `dispose' for nil: nilclass

0

Share this post


Link to post
Share on other sites
umm, parece que no llamaste 1 la clase xD "nilclass" es que no existe eso, tienes que crear el @hud primero, y recuerda que no se loopee para que no de errores.

Y es lo que te dije, tu activas y desactivas cuando quieres.
0

Share this post


Link to post
Share on other sites
OksxD muchas gracias amas de uno le abra servido.
0

Share this post


Link to post
Share on other sites
Esta muy bien este script para los ARPG, me ha gustado happy.gif

Salu2 icon13.gif
0

Share this post


Link to post
Share on other sites
¿Podriasis explicar un poco mas lo de activar y desactivar el script?

Gracias, salu2!!
0

Share this post


Link to post
Share on other sites
darklight, no me ha kedado del todo claro, como se desactivaria??
0

Share this post


Link to post
Share on other sites
Bueno Aqui tienes una version que se activa y desactiva mas facilmente.

Solamente apaga o prende el interruptor 10 para activar o desactivar el HUD.

[SPOILER]
CODE

#==============================================================================
# ** Game_Actor
# Script by MeisMe
# Graphics added by Peaches
# Icons made by Joshie666 & Axerax
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Get the current EXP
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get the next level's EXP
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end

#==============================================================================
# ** Window_HUD
#------------------------------------------------------------------------------
# This class is used to display HP, SP and Gold on the map.
#==============================================================================
class Window_HUD < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(-16, -16, 672, 150)
self.contents = Bitmap.new(width-32, height-32)
self.opacity = 0
self.contents.font.size = 14
self.contents.font.name = "Arial"
@actors = []
@old_hp = []
@old_sp = []
@old_exp = []
@old_level = []
for i in 0...$game_party.actors.size
@actors.push($game_party.actors[i])
@old_hp.push(@actors[i].hp)
@old_sp.push(@actors[i].sp)
@old_exp.push(@actors[i].now_exp)
@old_level.push(@actors[i].level)
end
@old_gold = $game_party.gold
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
#self.contents.draw_text(6, 0, 32, 14, $data_system.words.hp + "")
#self.contents.draw_text(6, 14, 32, 14, $data_system.words.sp + "")
self.contents.draw_text(6, 28, 32, 14, "")
#self.contents.draw_text(6, 42, 32, 14, $data_system.words.gold + "")
self.contents.font.color = normal_color
#Images

case @actors.size
when 1
bitmap = RPG::Cache.picture("HUD Graphic")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
when 2
bitmap = RPG::Cache.picture("HUD Graphic2")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
when 3
bitmap = RPG::Cache.picture("HUD Graphic2")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
when 4
bitmap = RPG::Cache.picture("HUD Graphic3")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 640, 500))
when 5
bitmap = RPG::Cache.picture("HUD Graphic3")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 640, 500))
end

#bitmap = RPG::Cache.picture("HUD Graphic")
#self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
bitmap = RPG::Cache.icon("HP Symbol")
self.contents.blt(3, 10, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("SP Symbol")
self.contents.blt(3, 30, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("EXP Symbol")
self.contents.blt(3, 50, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("Hero")
self.contents.blt(25, 67, bitmap, Rect.new(0, 0, 24, 24))

if $game_switches[99] == true
if $game_variables[99] == 0
self.contents.draw_text(x, y, 210, 14, $game_party.item_number[1])
elsif $game_variables[8] == 1
self.contents.draw_text(x, y, 210, 14, $game_party.item_number(2))
elsif $game_variables[8] ==2
self.contents.draw_text(x, y, 110, 14, @actors[i].name)
end
end
x = 32
for i in [email protected]
y = 6
self.contents.draw_text(x, y, 110, 14, @actors[i].name)
self.contents.draw_text(x, y, 110, 14, "Nv: #{@actors[i].level}", 2)
y += 16
draw_hp_bar(@actors[i], x, y, 112, 5)
y += 19
draw_sp_bar(@actors[i], x, y, 104, 5)
y += 19
draw_exp_bar(@actors[i], x, y, 88, 5)
y += 19
x += 130
end
x = 32
self.contents.draw_text(45, 73, 110, 14, $game_party.gold.to_s)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if @actors.size != $game_party.actors.size
@actors = []
for i in 0...$game_party.actors.size
@actors.push($game_party.actors[i])
end
refresh
return
end
for i in [email protected]
if @old_hp[i] != @actors[i].hp or
@old_sp[i] != @actors[i].sp or
@old_exp[i] != @actors[i].now_exp or
@old_level[i] != @actors[i].level or
@old_gold != $game_party.gold
refresh
@old_hp[i] = @actors[i].hp
@old_sp[i] = @actors[i].sp
@old_exp[i] = @actors[i].now_exp
@old_level[i] = @actors[i].level
@old_gold = $game_party.gold
end
end
end
#--------------------------------------------------------------------------
# * Draw HP Bar
#--------------------------------------------------------------------------
def draw_hp_bar(actor, x, y, length, thick)
width = length
height = thick
c1 = Color.new(255, 0, 0)
c2 = Color.new(155, 0, 0)
e1 = actor.hp
e2 = actor.maxhp
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
#--------------------------------------------------------------------------
# * Draw SP Bar
#--------------------------------------------------------------------------
def draw_sp_bar(actor, x, y, length, thick)
width = length
height = thick
c1 = Color.new(0, 0, 255)
c2 = Color.new(0, 0, 155)
e1 = actor.sp
e2 = actor.maxsp
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
#--------------------------------------------------------------------------
# * Draw EXP Bar
#--------------------------------------------------------------------------
def draw_exp_bar(actor, x, y, length, thick)
width = length
height = thick
c1 = Color.new(158, 208, 9)
c2 = Color.new(58, 108, 0)
e1 = actor.now_exp
e2 = actor.next_exp
if actor.next_exp == 0
e1 = 1
e2 = 1
end
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
end

#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Object Aliasing
#--------------------------------------------------------------------------
alias hud_scene_map_main main
alias hud_scene_map_update update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def main
@HUD = Window_HUD.new
@HUD.visible = $game_switches[10]
hud_scene_map_main
@HUD.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@HUD.update if @HUD.visible
hud_scene_map_update
end
end

[/SPOILER]
0

Share this post


Link to post
Share on other sites
Hum...
Lo acabo de probar y no me funciona. Puedo mostrar el "HUD" solo si activo el interruptor 10 en proceso paralelo al iniciar el juego(y no lo puedo quitar despues), pero si creo un evento y hago que active o desactive el interruptor no me funciona.
¿A ti te funciona Futhockey? ¿Hago algo mal?

Salu2!!

EDIT:
Ya me funciona, habia que poner tambien: @HUD.visible = $game_switches[10] en "def update" para que se actualizara en el mapa.
Os lo dejo aqui con esto corregido:
CODE
#==============================================================================
# ** Game_Actor
# Script by MeisMe
# Graphics added by Peaches
# Icons made by Joshie666 & Axerax
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================
class Game_Actor
#--------------------------------------------------------------------------
# * Get the current EXP
#--------------------------------------------------------------------------
def now_exp
return @exp - @exp_list[@level]
end
#--------------------------------------------------------------------------
# * Get the next level's EXP
#--------------------------------------------------------------------------
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end

#==============================================================================
# ** Window_HUD
#------------------------------------------------------------------------------
# This class is used to display HP, SP and Gold on the map.
#==============================================================================
class Window_HUD < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(-16, -16, 672, 150)
self.contents = Bitmap.new(width-32, height-32)
self.opacity = 0
self.contents.font.size = 14
self.contents.font.name = "Arial"
@actors = []
@old_hp = []
@old_sp = []
@old_exp = []
@old_level = []
for i in 0...$game_party.actors.size
@actors.push($game_party.actors[i])
@old_hp.push(@actors[i].hp)
@old_sp.push(@actors[i].sp)
@old_exp.push(@actors[i].now_exp)
@old_level.push(@actors[i].level)
end
@old_gold = $game_party.gold
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
#self.contents.draw_text(6, 0, 32, 14, $data_system.words.hp + "")
#self.contents.draw_text(6, 14, 32, 14, $data_system.words.sp + "")
self.contents.draw_text(6, 28, 32, 14, "")
#self.contents.draw_text(6, 42, 32, 14, $data_system.words.gold + "")
self.contents.font.color = normal_color
#Images

case @actors.size
when 1
bitmap = RPG::Cache.picture("HUD Graphic")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
when 2
bitmap = RPG::Cache.picture("HUD Graphic2")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
when 3
bitmap = RPG::Cache.picture("HUD Graphic2")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
when 4
bitmap = RPG::Cache.picture("HUD Graphic3")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 640, 500))
when 5
bitmap = RPG::Cache.picture("HUD Graphic3")
self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 640, 500))
end

#bitmap = RPG::Cache.picture("HUD Graphic")
#self.contents.blt(0, 0, bitmap, Rect.new(0, 10, 500, 500))
bitmap = RPG::Cache.icon("HP Symbol")
self.contents.blt(3, 10, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("SP Symbol")
self.contents.blt(3, 30, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("EXP Symbol")
self.contents.blt(3, 50, bitmap, Rect.new(0, 0, 24, 24))
bitmap = RPG::Cache.icon("Hero")
self.contents.blt(25, 67, bitmap, Rect.new(0, 0, 24, 24))

if $game_switches[99] == true
if $game_variables[99] == 0
self.contents.draw_text(x, y, 210, 14, $game_party.item_number[1])
elsif $game_variables[8] == 1
self.contents.draw_text(x, y, 210, 14, $game_party.item_number(2))
elsif $game_variables[8] ==2
self.contents.draw_text(x, y, 110, 14, @actors[i].name)
end
end
x = 32
for i in [email protected]
y = 6
self.contents.draw_text(x, y, 110, 14, @actors[i].name)
self.contents.draw_text(x, y, 110, 14, "Nv: #{@actors[i].level}", 2)
y += 16
draw_hp_bar(@actors[i], x, y, 112, 5)
y += 19
draw_sp_bar(@actors[i], x, y, 104, 5)
y += 19
draw_exp_bar(@actors[i], x, y, 88, 5)
y += 19
x += 130
end
x = 32
self.contents.draw_text(45, 73, 110, 14, $game_party.gold.to_s)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if @actors.size != $game_party.actors.size
@actors = []
for i in 0...$game_party.actors.size
@actors.push($game_party.actors[i])
end
refresh
return
end
for i in [email protected]
if @old_hp[i] != @actors[i].hp or
@old_sp[i] != @actors[i].sp or
@old_exp[i] != @actors[i].now_exp or
@old_level[i] != @actors[i].level or
@old_gold != $game_party.gold
refresh
@old_hp[i] = @actors[i].hp
@old_sp[i] = @actors[i].sp
@old_exp[i] = @actors[i].now_exp
@old_level[i] = @actors[i].level
@old_gold = $game_party.gold
end
end
end
#--------------------------------------------------------------------------
# * Draw HP Bar
#--------------------------------------------------------------------------
def draw_hp_bar(actor, x, y, length, thick)
width = length
height = thick
c1 = Color.new(255, 0, 0)
c2 = Color.new(155, 0, 0)
e1 = actor.hp
e2 = actor.maxhp
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
#--------------------------------------------------------------------------
# * Draw SP Bar
#--------------------------------------------------------------------------
def draw_sp_bar(actor, x, y, length, thick)
width = length
height = thick
c1 = Color.new(0, 0, 255)
c2 = Color.new(0, 0, 155)
e1 = actor.sp
e2 = actor.maxsp
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
#--------------------------------------------------------------------------
# * Draw EXP Bar
#--------------------------------------------------------------------------
def draw_exp_bar(actor, x, y, length, thick)
width = length
height = thick
c1 = Color.new(158, 208, 9)
c2 = Color.new(58, 108, 0)
e1 = actor.now_exp
e2 = actor.next_exp
if actor.next_exp == 0
e1 = 1
e2 = 1
end
self.contents.fill_rect(x-1, y - 1, width+2, height + 3, Color.new(255, 255, 255, 255))
self.contents.fill_rect(x, y, width, height + 1, Color.new(0, 0, 0, 255))
w = width * e1 / e2
for i in 0..height
r = c1.red + (c2.red - c1.red) * (height -i)/height + 0 * i/height
g = c1.green + (c2.green - c1.green) * (height -i)/height + 0 * i/height
b = c1.blue + (c2.blue - c1.blue) * (height -i)/height + 0 * i/height
a = c1.alpha + (c2.alpha - c1.alpha)* (height -i)/height + 255 * i/height
self.contents.fill_rect(x, y+i, w, 1, Color.new(r, g, b, a))
end
end
end

#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Object Aliasing
#--------------------------------------------------------------------------
alias hud_scene_map_main main
alias hud_scene_map_update update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def main
@HUD = Window_HUD.new
@HUD.visible = $game_switches[10]
hud_scene_map_main
@HUD.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@HUD.update if @HUD.visible
@HUD.visible = $game_switches[10]
hud_scene_map_update
end
end


Muchas gracias por la ayuda sephirothtds!! Edited by Eis
0

Share this post


Link to post
Share on other sites
Bueno, pues actualizaré con este último el primer post para que sea más fácil verlo. Gracias a todos. icon13.gif
0

Share this post


Link to post
Share on other sites
gracias eis, no lo habia probado aun e ido a probarlo y no iba xD he venido a cmoentarlo y ya lo habias solucionado. Gracias a todos icon13.gif
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0