Intro
Bom Galera Não sei quase nada de RGSS mais estava vendo algumas aulas e fiz uma HUD simples
Código:
Screen
Pictures
Clique Aqui
Bom Galera Não sei quase nada de RGSS mais estava vendo algumas aulas e fiz uma HUD simples
Código:
- Código:
# HudChaves 1.0 Criado por Chavesvga #
X = 0
Y = 0
Largura = 300
Altura = 120
class Hud < Window_Base
def initialize
super(X,Y,Largura,Altura)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
@ator = 0
refresh
end
def refresh
self.contents.clear
actor = $game_party.actors[0]
#Inicio Do Conteudo da HUDChaves
draw_actor_hp_bar_1(actor, 13, 20)
draw_actor_sp_bar_1(actor, 13, 40)
draw_actor_graphic(actor, 10, 52)
draw_actor_name(actor, 0, 42)
draw_actor_class(actor, 45, -9)
draw_actor_level(actor, 0, 65)
draw_actor_hp(actor, 50, 20, width = 144)
draw_actor_sp(actor, 50, 40, width = 144)
#Acaba Aqui =D
if $scene.is_a?(Scene_Menu)
self.contents.clear
end
if $scene.is_a?(Scene_Battle)
self.contents.clear
self.visible = false
end
end
end
#Adiciona a janela a o mapa.
class Scene_Map
alias hud_main main
def main
@Hud = Hud.new
hud_main
@Hud.dispose
end
alias hud_update update
def update
hud_update
@Hud.update
@Hud.refresh
end
end
class Window_Base < Window
def draw_actor_hp_bar_1(actor, x, y)
back = RPG::Cache.picture("chaves_barra_fundo")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("chaves_barra_HP")
cw = meter.width * actor.hp / actor.maxhp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
end
def draw_actor_sp_bar_1(actor, x, y)
back = RPG::Cache.picture("chaves_barra_fundo")
cw = back.width
ch = back.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, back, src_rect)
meter = RPG::Cache.picture("chaves_barra_SP")
cw = meter.width * actor.sp / actor.maxsp
ch = meter.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x + 65, y - ch + 30, meter, src_rect)
end
end
Screen
Pictures
Clique Aqui