Project1
标题:
VX地图界面显示主人公血魔
[打印本页]
作者:
qq894033418
时间:
2012-7-27 00:05
标题:
VX地图界面显示主人公血魔
请问如何在地图界面显示主人公的血魔条,只需要最简单的2个条就好。一红一蓝,进入战斗消失。
最好能告诉我如何更改位置和颜色 非常感谢 dsu_plus_rewardpost_czw
作者:
a364774426
时间:
2012-7-27 01:16
本帖最后由 a364774426 于 2012-7-27 01:19 编辑
#============================================================================
# Jens009 Simple HP/SP/State HUD
# Version 2.0
# Release Date: August 11,2008
# Description: Display an HP/SP and State HUD information in map.
# Compatibility: Should be compatible with any system
# Configuration:
# I. Turning off the HUD in game
# use the call script $game_system.show_hud = true/false
# true = show HUD, false = disable HUD
# II. Changing maximum information shown
# look at SHOW_MAX under JCONFIG, you can change the value to show
# how many of the actors in the party to display their information
# by default, it is set to show only 2 actors.
# III. Changing maximum information shown in game
# use the call script JCONFIG::SHOW_MAX = *integer*
# You can change the amount of actors displayed in the HUD in game.
# simply change integer to the value you want.
# IV. Changing Update methods
# if you want the HUD to always update, set ALWAYS_UPDATE_HUD to true
# but if you want to only update the HUD whenever you want to, set
# this to false.
# When $game_sysyem.always_update is false, you can update the hud
# manually in game using the call script $game_system.refresh_hud = true.
# this will refresh the hud information once.
# However, you can also switch between always updating the HUD and
# only updating the hud once during in game.
# Simply use the call script:
# $game_sysyem.always_update = true/false
# and to reupdate once
# $game_system.refresh_hud = true
#
# Optimization to achieve higher FPS
# 1) Set SHOW_MAX to a low value
# You can also:
# 2) Set $game_sysyem.always_update = false
# 2.1) Use $game_temp.refresh_hud = true to reupdate the hud manually.
#============================================================================
module JCONFIG
SHOW_MAX = 6 # By default, show 4 actor's information
end
#======================================
# Game_System edit
#=====================================
class Game_System
# Add new instance
attr_accessor :refresh_hud
attr_accessor :show_hud
attr_accessor :always_update
alias jens009_initialize_hud initialize
def initialize
# Initialize instances
@show_hud = true
@always_update = true
@refresh_hud = false
# Call default methods
jens009_initialize_hud
end
end
#=============================================================================
# Window Hud < Window_Base
# Description: Handles Information to be shown in HUD
#=============================================================================
class Window_Hud < Window_Base
#==========================
# Initialize Values
#==========================
def initialize
super(80,520,800,608)
self.opacity = 0
self.visible = false if $game_system.show_hud == false
refresh
end
#=========================
# Create Information
#===========================
def refresh
self.contents.clear
@item_max = JCONFIG::SHOW_MAX
@party_size = $game_party.members.size
for actor in $game_party.members
x = actor.index * 120
y = 0#actor.index * 80
if actor.index < @item_max
draw_actor_information(actor, x, y)
end
end
end
def draw_actor_information(actor, x, y)
draw_actor_name (actor, x, y + 0)
draw_actor_graphic(actor, x + 15, y + 60)
draw_actor_hp_gauge(actor, x + 30, y + 20, 70)
draw_actor_mp_gauge(actor, x + 30, y + 30, 70)
end
#=================================
# Define Update
#====================================
def update
refresh
end
end
#===============================
# Start Scene_Map edit
#===============================
class Scene_Map
# Alias methods main, update and terminate
alias jens009_hud_main main
alias jens009_hud_update update
alias jens009_hud_terminate terminate
# Edit Main
def main
# Call HUD
@hud = Window_Hud.new
# Call previous Methods
jens009_hud_main
end
# Edit Update
def update
# Update hud only if $game_system.show_hud is true
if $game_system.show_hud and $game_system.always_update
@hud.update
end
if $game_system.refresh_hud == true
@hud.update
$game_system.refresh_hud = false
end
if $game_system.show_hud == true
@hud.visible = true
else
@hud.visible = false
end
# Call previous methods
jens009_hud_update
end
# Edit Terminate
def terminate
# Call previous methods, dispose of other windows first before HUD
jens009_hud_terminate
# Dispose HUD
@hud.dispose
end
#========================
# End of Scene_Map edit
#========================
end
复制代码
试试这个能用否
74行处我改了坐标,你自己调一调���
作者:
四代天殇
时间:
2012-8-10 22:30
a364774426 发表于 2012-7-27 01:16
试试这个能用否
74行处我改了坐标,你自己调一调���
我大概看了一下这个代码,但是我没有看到 HUD的CLASS,于是我在这个脚本的前面加了$game_system.show_hud = false
但是测试时发现我的VX并没有SHOW_HUD的CLASS
所以我想这个脚本是不是建立在另外一个脚本上的?
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1