Krótki opis:
Pokazuje stan życia bohatera, SP, Lv, złoto i uzbrojenie.
Autor:
DarkCloud
Kompatybilność:
RPG Maker XP
Skrypt:
Spoiler:
Kod:
#==============================================================================
# Pretty and Simple HUD+ v.0.5 by DarkCloud [19.10.08r]
#==============================================================================
#==============================================================================
# * Config
#==============================================================================
# Tego lepiej nie zmianiaj =D
LEFT = 0
RIGHT = 464
UP = 0
DOWN = 230
LEFT2 = -16
RIGHT2 = 448
UP2 = -16
DOWN2 = 214
# Pozycja HUD'a w osi X (LEFT - Lewy róg, RIGHT - Prawy róg)
HUDX_POSITION = RIGHT
HUDX_POSITION2 = RIGHT2
# Pozycja HUD'a w osi Y (UP - Górny róg, DOWN - Dolny róg)
HUDY_POSITION = UP
HUDY_POSITION2 = UP2
# Przezroczystość HUD'a (Od 0 do 255)
OPACITY = 200
#==============================================================================
# END of Config
#==============================================================================
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================
class Window_Base < Window
#=====================================
# Actor Name
#=====================================
def draw_actor_name2(actor, x, y)
self.contents.font.name = "Verdana"
self.contents.font.color = Color.new(255, 255, 255, OPACITY)
self.contents.font.size = 18
self.contents.font.bold = true
self.contents.draw_text(x, y, 120, 32, actor.name)
self.contents.font.bold = false
end
#=====================================
# Actor level
#=====================================
def draw_actor_lv(actor, x, y)
self.contents.font.name = "Verdana"
self.contents.font.color = Color.new(255, 255, 255, OPACITY)
self.contents.font.size = 18
self.contents.font.bold = true
self.contents.draw_text(x, y, 32, 32, "Lv")
self.contents.draw_text(x + 23, y, 24, 32, actor.level.to_s, 2)
self.contents.font.bold = false
end
#=====================================
# Actor HP bar
#=====================================
def draw_actor_hp_bar(actor, x, y)
@actor = $game_party.actors[0]
whp = 106 * @actor.hp / @actor.maxhp
self.contents.fill_rect(x, y, whp, 1, Color.new(232, 0, 0, OPACITY))
self.contents.fill_rect(x, y + 1, whp, 1, Color.new(215, 0, 0, OPACITY))
self.contents.fill_rect(x, y + 2, whp, 1, Color.new(195, 0, 0, OPACITY))
self.contents.fill_rect(x, y + 3, whp, 1, Color.new(165, 0, 0, OPACITY))
self.contents.fill_rect(x, y + 4, whp, 1, Color.new(145, 0, 0, OPACITY))
self.contents.fill_rect(x, y + 5, whp, 1, Color.new(130, 0, 0, OPACITY))
self.contents.fill_rect(x, y + 6, whp, 1, Color.new(105, 0, 0, OPACITY))
self.contents.fill_rect(x, y + 7, whp, 1, Color.new(75, 0, 0, OPACITY))
self.contents.fill_rect(x, y + 8, whp, 1, Color.new(55, 0, 0, OPACITY))
self.contents.fill_rect(x, y + 9, whp, 1, Color.new(25, 0, 0, OPACITY))
self.contents.font.name = "Palatino Linotype"
self.contents.font.size = 16
self.contents.font.color = Color.new(0, 0, 0, OPACITY)
self.contents.draw_text(x + 6, y - 10, 32, 32, $data_system.words.hp)
self.contents.font.color = Color.new(255, 255, 255, OPACITY)
self.contents.draw_text(x + 5, y - 11, 32, 32, $data_system.words.hp)
end
#=====================================
# Actor SP bar
#=====================================
def draw_actor_sp_bar(actor, x, y)
@actor = $game_party.actors[0]
wsp = 106 * @actor.sp / @actor.maxsp
self.contents.fill_rect(x, y, wsp, 1, Color.new(0, 0, 232, OPACITY))
self.contents.fill_rect(x, y + 1, wsp, 1, Color.new(0, 0, 215, OPACITY))
self.contents.fill_rect(x, y + 2, wsp, 1, Color.new(0, 0, 195, OPACITY))
self.contents.fill_rect(x, y + 3, wsp, 1, Color.new(0, 0, 165, OPACITY))
self.contents.fill_rect(x, y + 4, wsp, 1, Color.new(0, 0, 145, OPACITY))
self.contents.fill_rect(x, y + 5, wsp, 1, Color.new(0, 0, 130, OPACITY))
self.contents.fill_rect(x, y + 6, wsp, 1, Color.new(0, 0, 105, OPACITY))
self.contents.fill_rect(x, y + 7, wsp, 1, Color.new(0, 0, 75, OPACITY))
self.contents.fill_rect(x, y + 8, wsp, 1, Color.new(0, 0, 55, OPACITY))
self.contents.fill_rect(x, y + 9, wsp, 1, Color.new(0, 0, 25, OPACITY))
self.contents.font.name = "Palatino Linotype"
self.contents.font.size = 16
self.contents.font.color = Color.new(0, 0, 0, OPACITY)
self.contents.draw_text(x + 6, y - 10, 32, 32, $data_system.words.sp)
self.contents.font.color = Color.new(255, 255, 255, OPACITY)
self.contents.draw_text(x + 5, y - 11, 32, 32, $data_system.words.sp)
end
#=====================================
# Actor Exp bar
#=====================================
def draw_actor_exp_bar(actor, x, y)
@actor = $game_party.actors[0]
exp1 = actor.now_exp
exp2 = actor.next_exp
if actor.next_exp == 0
exp1 = 1
exp2 = 1
end
wexp = 106 * exp1 / exp2
self.contents.fill_rect(x, y, wexp, 1, Color.new(0, 232, 0, OPACITY))
self.contents.fill_rect(x, y + 1, wexp, 1, Color.new(0, 215, 0, OPACITY))
self.contents.fill_rect(x, y + 2, wexp, 1, Color.new(0, 195, 0, OPACITY))
self.contents.fill_rect(x, y + 3, wexp, 1, Color.new(0, 165, 0, OPACITY))
self.contents.fill_rect(x, y + 4, wexp, 1, Color.new(0, 145, 0, OPACITY))
self.contents.fill_rect(x, y + 5, wexp, 1, Color.new(0, 130, 0, OPACITY))
self.contents.fill_rect(x, y + 6, wexp, 1, Color.new(0, 105, 0, OPACITY))
self.contents.fill_rect(x, y + 7, wexp, 1, Color.new(0, 75, 0, OPACITY))
self.contents.fill_rect(x, y + 8, wexp, 1, Color.new(0, 55, 0, OPACITY))
self.contents.fill_rect(x, y + 9, wexp, 1, Color.new(0, 25, 0, OPACITY))
self.contents.font.name = "Palatino Linotype"
self.contents.font.size = 16
self.contents.font.color = Color.new(0, 0, 0, OPACITY)
self.contents.draw_text(x + 6, y - 10, 32, 32, "Exp")
self.contents.font.color = Color.new(255, 255, 255, OPACITY)
self.contents.draw_text(x + 5, y - 11, 32, 32, "Exp")
end
#=====================================
# Gold
#=====================================
def draw_gold(actor, x, y)
self.contents.font.name = "Verdana"
self.contents.font.color = Color.new(255, 255, 0, OPACITY)
self.contents.font.size = 16
self.contents.font.bold = true
self.contents.draw_text(x, y, 120, 32, $game_party.gold.to_s, 2)
self.contents.font.bold = false
end
#=====================================
# Actor STR bar
#=====================================
def draw_actor_str_bar(actor, x, y)
@actor = $game_party.actors[0]
str = actor.str
wstr = 46 * str / 999
self.contents.fill_rect(x, y, wstr, 1, Color.new(232, 232, 0, OPACITY))
self.contents.fill_rect(x, y + 1, wstr, 1, Color.new(215, 215, 0, OPACITY))
self.contents.fill_rect(x, y + 2, wstr, 1, Color.new(195, 195, 0, OPACITY))
self.contents.fill_rect(x, y + 3, wstr, 1, Color.new(165, 165, 0, OPACITY))
self.contents.fill_rect(x, y + 4, wstr, 1, Color.new(145, 145, 0, OPACITY))
self.contents.fill_rect(x, y + 5, wstr, 1, Color.new(130, 130, 0, OPACITY))
self.contents.fill_rect(x, y + 6, wstr, 1, Color.new(105, 105, 0, OPACITY))
self.contents.fill_rect(x, y + 7, wstr, 1, Color.new(75, 75, 0, OPACITY))
self.contents.fill_rect(x, y + 8, wstr, 1, Color.new(55, 55, 0, OPACITY))
self.contents.fill_rect(x, y + 9, wstr, 1, Color.new(25, 25, 0, OPACITY))
self.contents.font.name = "Palatino Linotype"
self.contents.font.size = 16
self.contents.font.color = Color.new(0, 0, 0, OPACITY)
self.contents.draw_text(x + 6, y - 10, 32, 32, actor.str.to_s)
self.contents.font.color = Color.new(255, 255, 255, OPACITY)
self.contents.draw_text(x + 5, y - 11, 32, 32, actor.str.to_s)
end
#=====================================
# Actor DEX bar
#=====================================
def draw_actor_dex_bar(actor, x, y)
@actor = $game_party.actors[0]
dex = actor.dex
wdex = 46 * dex / 999
self.contents.fill_rect(x, y, wdex, 1, Color.new(232, 232, 0, OPACITY))
self.contents.fill_rect(x, y + 1, wdex, 1, Color.new(215, 215, 0, OPACITY))
self.contents.fill_rect(x, y + 2, wdex, 1, Color.new(195, 195, 0, OPACITY))
self.contents.fill_rect(x, y + 3, wdex, 1, Color.new(165, 165, 0, OPACITY))
self.contents.fill_rect(x, y + 4, wdex, 1, Color.new(145, 145, 0, OPACITY))
self.contents.fill_rect(x, y + 5, wdex, 1, Color.new(130, 130, 0, OPACITY))
self.contents.fill_rect(x, y + 6, wdex, 1, Color.new(105, 105, 0, OPACITY))
self.contents.fill_rect(x, y + 7, wdex, 1, Color.new(75, 75, 0, OPACITY))
self.contents.fill_rect(x, y + 8, wdex, 1, Color.new(55, 55, 0, OPACITY))
self.contents.fill_rect(x, y + 9, wdex, 1, Color.new(25, 25, 0, OPACITY))
self.contents.font.name = "Palatino Linotype"
self.contents.font.size = 16
self.contents.font.color = Color.new(0, 0, 0, OPACITY)
self.contents.draw_text(x + 6, y - 10, 32, 32, actor.dex.to_s)
self.contents.font.color = Color.new(255, 255, 255, OPACITY)
self.contents.draw_text(x + 5, y - 11, 32, 32, actor.dex.to_s)
end
#=====================================
# Actor AGI bar
#=====================================
def draw_actor_agi_bar(actor, x, y)
@actor = $game_party.actors[0]
agi = actor.agi
wagi = 46 * agi / 999
self.contents.fill_rect(x, y, wagi, 1, Color.new(232, 232, 0, OPACITY))
self.contents.fill_rect(x, y + 1, wagi, 1, Color.new(215, 215, 0, OPACITY))
self.contents.fill_rect(x, y + 2, wagi, 1, Color.new(195, 195, 0, OPACITY))
self.contents.fill_rect(x, y + 3, wagi, 1, Color.new(165, 165, 0, OPACITY))
self.contents.fill_rect(x, y + 4, wagi, 1, Color.new(145, 145, 0, OPACITY))
self.contents.fill_rect(x, y + 5, wagi, 1, Color.new(130, 130, 0, OPACITY))
self.contents.fill_rect(x, y + 6, wagi, 1, Color.new(105, 105, 0, OPACITY))
self.contents.fill_rect(x, y + 7, wagi, 1, Color.new(75, 75, 0, OPACITY))
self.contents.fill_rect(x, y + 8, wagi, 1, Color.new(55, 55, 0, OPACITY))
self.contents.fill_rect(x, y + 9, wagi, 1, Color.new(25, 25, 0, OPACITY))
self.contents.font.name = "Palatino Linotype"
self.contents.font.size = 16
self.contents.font.color = Color.new(0, 0, 0, OPACITY)
self.contents.draw_text(x + 6, y - 10, 32, 32, actor.agi.to_s)
self.contents.font.color = Color.new(255, 255, 255, OPACITY)
self.contents.draw_text(x + 5, y - 11, 32, 32, actor.agi.to_s)
end
#=====================================
# Actor INT bar
#=====================================
def draw_actor_int_bar(actor, x, y)
@actor = $game_party.actors[0]
int = actor.int
wint = 46 * int / 999
self.contents.fill_rect(x, y, wint, 1, Color.new(232, 232, 0, OPACITY))
self.contents.fill_rect(x, y + 1, wint, 1, Color.new(215, 215, 0, OPACITY))
self.contents.fill_rect(x, y + 2, wint, 1, Color.new(195, 195, 0, OPACITY))
self.contents.fill_rect(x, y + 3, wint, 1, Color.new(165, 165, 0, OPACITY))
self.contents.fill_rect(x, y + 4, wint, 1, Color.new(145, 145, 0, OPACITY))
self.contents.fill_rect(x, y + 5, wint, 1, Color.new(130, 130, 0, OPACITY))
self.contents.fill_rect(x, y + 6, wint, 1, Color.new(105, 105, 0, OPACITY))
self.contents.fill_rect(x, y + 7, wint, 1, Color.new(75, 75, 0, OPACITY))
self.contents.fill_rect(x, y + 8, wint, 1, Color.new(55, 55, 0, OPACITY))
self.contents.fill_rect(x, y + 9, wint, 1, Color.new(25, 25, 0, OPACITY))
self.contents.font.name = "Palatino Linotype"
self.contents.font.size = 16
self.contents.font.color = Color.new(0, 0, 0, OPACITY)
self.contents.draw_text(x + 6, y - 10, 32, 32, actor.int.to_s)
self.contents.font.color = Color.new(255, 255, 255, OPACITY)
self.contents.draw_text(x + 5, y - 11, 32, 32, actor.int.to_s)
end
#=====================================
# Item icon
#=====================================
def draw_item_icon(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
end
end
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# 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 < Game_Battler
#--------------------------------------------------------------------------
# * 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
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make sprite set
@spriteset = Spriteset_Map.new
# Make message window
@message_window = Window_Message.new
# Make HUD window
@hud = Scene_HUD.new
# Transition run
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of sprite set
@spriteset.dispose
# Dispose of message window
@message_window.dispose
# Dispose of HUD window
@hud.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Loop
loop do
# Update map, interpreter, and player order
# (this update order is important for when conditions are fulfilled
# to run any event, and the player isn't provided the opportunity to
# move in an instant)
$game_map.update
$game_system.map_interpreter.update
$game_player.update
# Update system (timer), screen
$game_system.update
$game_screen.update
# Abort loop if player isn't place moving
unless $game_temp.player_transferring
break
end
# Run place move
transfer_player
# Abort loop if transition processing
if $game_temp.transition_processing
break
end
end
# Update sprite set
@spriteset.update
# Update message window
@message_window.update
@hud.update
# If game over
if $game_temp.gameover
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If returning to title screen
if $game_temp.to_title
# Change to title screen
$scene = Scene_Title.new
return
end
# If transition processing
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# If showing message window
if $game_temp.message_window_showing
return
end
# If encounter list isn't empty, and encounter count is 0
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
# If event is running or encounter is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
# Confirm troop
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
# If troop is valid
if $data_troops[troop_id] != nil
# Set battle calling flag
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
# If B button was pressed
if Input.trigger?(Input::B)
# If event is running, or menu is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
# Set menu calling flag or beep flag
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
# If debug mode is ON and F9 key was pressed
if $DEBUG and Input.press?(Input::F9)
# Set debug calling flag
$game_temp.debug_calling = true
end
# If player is not moving
unless $game_player.moving?
# Run calling of each screen
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
#--------------------------------------------------------------------------
# * Player Place Move
#--------------------------------------------------------------------------
def transfer_player
# Clear player place move call flag
$game_temp.player_transferring = false
# If move destination is different than current map
if $game_map.map_id != $game_temp.player_new_map_id
# Set up a new map
$game_map.setup($game_temp.player_new_map_id)
end
# Set up player position
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
# Set player direction
case $game_temp.player_new_direction
when 2 # down
$game_player.turn_down
when 4 # left
$game_player.turn_left
when 6 # right
$game_player.turn_right
when 8 # up
$game_player.turn_up
end
# Straighten player position
$game_player.straighten
# Update map (run parallel process event)
$game_map.update
# Remake sprite set
@spriteset.dispose
@spriteset = Spriteset_Map.new
# Remake hud window
@hud.dispose
@hud = Scene_HUD.new
# If processing transition
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
Graphics.transition(20)
end
# Run automatic change for BGM and BGS set on the map
$game_map.autoplay
# Frame reset
Graphics.frame_reset
# Update input information
Input.update
end
end
Hmm..podobny HUD jest w popularnej grze Margonem ;)
Mógłby ktoś to podkoloryzować ,aby ładniej wyglądało?!
Oczywiście dodam do mojego projektu.
Mam jedno pytanko...Wszystko okej, wgrałem skrypt oraz grafikę..włączam test gry i co?!
I nie widzę żadnego Hudu ;x ..a tylko wgrany RingMenu..Co mam zrobić?
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