def draw_actor_exp_HUD(actor, x, y, width)
s1 = actor.exp_s
s2 = actor.next_rest_exp_s + s1
if s1.is_a? String or s2.is_a? String
s1 = actor.exp
s2 = actor.exp
end
draw_actor_exp_gauge(actor, x, y, s1, s2, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, EXP_NAME)
self.contents.font.color = normal_color
last_font_size = self.contents.font.size
xr = x + width
self.contents.draw_text(xr - 120, y, 120, WLH, s1, 2)
end
def draw_actor_exp_gauge(actor, x, y, s1, s2, width)
gw = width * s1 / s2
gc1 = text_color(31)
gc2 = text_color(27)
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
def update
self.visible = $game_system.hud_display
return if !self.visible
if @hp != @actor.hp or
@mp != @actor.mp or
@exp != @actor.exp or
@name != @actor.name or
@level != @actor.level or
@face != [@actor.face_name, @actor.face_index]
refresh
end
hide_status
end
end
#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
alias start_hmexp_name_face_lvl start
alias terminate_hmexp_name_face_lvl terminate
alias update_hmexp_name_face_lvl update
def start
start_hmexp_name_face_lvl
@index = HUD_HP_MP_EXP_NAME_FACE_LEVEL::ACTOR_ID
new_hud
end
def terminate
@hp_mp_exp_name_face_hud.dispose
terminate_hmexp_name_face_lvl
end
def update
update_hmexp_name_face_lvl
@hp_mp_exp_name_face_hud.update
return if !HUD_HP_MP_EXP_NAME_FACE_LEVEL::CYCLE
return if !@hp_mp_exp_name_face_hud.visible
if Input.trigger?(Input::R)
if @index == $game_party.members.size - 1
@index = 0
else
@index += 1
end
elsif Input.trigger?(Input::L)
if @index == 0
@index = $game_party.members.size - 1
else
@index -= 1
end
end
new_hud if @index != @hp_mp_exp_name_face_hud.index
end
def new_hud
@hp_mp_exp_name_face_hud.dispose if !@hp_mp_exp_name_face_hud.nil?
@hp_mp_exp_name_face_hud = Window_HUD_HP_MP_EXP_NAME_FACE_LEVEL.new(@index)
end
end
#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
alias hud_initialize initialize
attr_accessor :hud_display
def initialize
hud_initialize
@hud_display = HUD_HP_MP_EXP_NAME_FACE_LEVEL::HUD_START_DISPLAY
end
end
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Wto 01 Gru, 2009 08:22
Postanowiłam nieco poprawić skrypt zamieszczony przez serb7. Dodałam opcję zmiany położenia HUD - wystarczy zmienić cyfrę przy POŁOŻENIE_HUD. Reszta informacji w skrypcie.
A to skrypt:
Spoiler:
Kod:
################################################################################
# #
# ~~~~~ Copyright 2009 SojaBird ~~~~~ #
# #
################################################################################
# Tłumaczenie i korekta by Ayene
#
# By wyświetlić/ukryć HUD, wywołaj skrypt "hud"
# By wyświetlić/ukryć HUD, wywołaj skrypt "hud(true)" lub "hud(false)"
def draw_actor_exp_HUD(actor, x, y, width)
s1 = actor.exp_s
s2 = actor.next_rest_exp_s + s1
if s1.is_a? String or s2.is_a? String
s1 = actor.exp
s2 = actor.exp
end
draw_actor_exp_gauge(actor, x, y, s1, s2, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, EXP_NAME)
self.contents.font.color = normal_color
last_font_size = self.contents.font.size
xr = x + width
self.contents.draw_text(xr - 120, y, 120, WLH, s1, 2)
end
def draw_actor_exp_gauge(actor, x, y, s1, s2, width)
gw = width * s1 / s2
gc1 = text_color(31)
gc2 = text_color(27)
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
def update
self.visible = $game_system.hud_display
return if !self.visible
if @hp != @actor.hp or
@mp != @actor.mp or
@exp != @actor.exp or
@name != @actor.name or
@level != @actor.level or
@face != [@actor.face_name, @actor.face_index]
refresh
end
hide_status
end
end
#------------------------------------------------------------
# * Scene_Map: Attach HUD to map
#------------------------------------------------------------
class Scene_Map < Scene_Base
alias start_hmexp_name_face_lvl start
alias terminate_hmexp_name_face_lvl terminate
alias update_hmexp_name_face_lvl update
def start
start_hmexp_name_face_lvl
@index = HUD_HP_MP_EXP_NAME_FACE_LEVEL::ACTOR_ID
new_hud
end
def terminate
@hp_mp_exp_name_face_hud.dispose
terminate_hmexp_name_face_lvl
end
def update
update_hmexp_name_face_lvl
@hp_mp_exp_name_face_hud.update
return if !HUD_HP_MP_EXP_NAME_FACE_LEVEL::CYCLE
return if !@hp_mp_exp_name_face_hud.visible
if Input.trigger?(Input::R)
if @index == $game_party.members.size - 1
@index = 0
else
@index += 1
end
elsif Input.trigger?(Input::L)
if @index == 0
@index = $game_party.members.size - 1
else
@index -= 1
end
end
new_hud if @index != @hp_mp_exp_name_face_hud.index
end
def new_hud
@hp_mp_exp_name_face_hud.dispose if !@hp_mp_exp_name_face_hud.nil?
@hp_mp_exp_name_face_hud = Window_HUD_HP_MP_EXP_NAME_FACE_LEVEL.new(@index)
end
end
#------------------------------------------------------------
# * Game_System: Check for display
#------------------------------------------------------------
class Game_System
alias hud_initialize initialize
attr_accessor :hud_display
def initialize
hud_initialize
@hud_display = HUD_HP_MP_EXP_NAME_FACE_LEVEL::HUD_START_DISPLAY
end
end
Pomógł: 1 raz Dołączył: 21 Maj 2010 Posty: 236 Skąd: z nikąd
Wysłany: Czw 03 Cze, 2010 10:25
Ja mam problem: chcę aby HUD było w lewym dolnym rogu,
ale nie umiem zmienić położenia. Proszę o pomoc.
(nie mówcie tylko abym zmienił cyrfrę przy Położenie_Hud, bo nie umiem)
________________________ 89% graczy uważa, że najważniejsza jest grafika.
Jeśli należysz do pozostałych 11% wklej to do swojego podpisu.
witam wszystkich. jestem poczatkujacy w tych sprawach i mam drobny problem, a mianowicie nie wiem jak w RPG MAKER VX zrobic aby za pomocą klawisza X ( w grze A) wyswietlala sie minimapka, a po ponownym wcisnieciu aby sie wylaczala. prosze o szybka odpowiedz
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Sob 26 Cze, 2010 20:07
Najszybciej będzie jak znajdziesz:
Kod:
if Input.trigger?(Input::R)
i dodasz przed tym:
Kod:
if Input.trigger?(Input::X)
if @hp_mp_exp_name_face_hud.visible
@hp_mp_exp_name_face_hud.visible = false
else
@hp_mp_exp_name_face_hud.visible = true
end
end
oraz znajdziesz i postawisz znaczek "#" na początku poniższych linijek:
Kod:
return if !@hp_mp_exp_name_face_hud.visible
Kod:
self.visible = $game_system.hud_display
Ostania pojawia się dwa razy w skrypcie.
Powinno działać.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum