Project1
标题:
如何在戰鬥時顯示人物頭像????順便問一下如何改血條??????
[打印本页]
作者:
nozxxx
时间:
2011-11-4 13:36
标题:
如何在戰鬥時顯示人物頭像????順便問一下如何改血條??????
本帖最后由 nozxxx 于 2011-11-4 16:15 编辑
我是新人......三天前剛裝RMVX........
請教各位大大.......VX如何在戰鬥時顯示人物頭像????
就如下圖...........
順便問一下如何改血條?????? dsu_plus_rewardpost_czw
作者:
小白玩家
时间:
2011-11-4 14:26
看不到图
作者:
小白玩家
时间:
2011-11-4 14:28
横版的好
22.jpg
(65.2 KB, 下载次数: 15)
下载附件
保存到相册
2011-11-4 14:27 上传
作者:
MSQ
时间:
2011-11-4 14:34
楼主的头像~~
发个收藏的脚本~~
#==============================================================================
# ☆ Window_BattleFaceStatus Ver.1.00
#------------------------------------------------------------------------------
# バトル画面でパーティメンバーのステータスを顔表示するウィンドウです。
#==============================================================================
class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# ☆ オブジェクト初期化 <追加変更>
#--------------------------------------------------------------------------
def initialize
super(0, 0-16, 416, 128+32)#変更
@item_max = 1 # 追加: 項目数
@column_max = 4 # 追加: 桁数
@index = -1 # 追加: カーソル位置
@spacing = 0 # 追加: 横に項目が並ぶときの空白の幅
self.opacity = 0 # 追加: ウィンドウ背景透明
refresh
self.active = false
end
#--------------------------------------------------------------------------
# ☆ 項目を描画する矩形の取得 <新規追加>
# index : 項目番号
#--------------------------------------------------------------------------
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
@column_max=$game_party.members.size
#rect.width = (contents.width + @spacing) / @column_max - @spacing
#rect.height = contents.height + 32 -32
#rect.x = index % @column_max * (rect.width + @spacing)
#rect.y = index / @column_max - 16 +16 #* WLH
rect.width = (contents.width + @spacing) / @column_max - @spacing
rect.width=96 if @column_max<4
rect.height = contents.height + 32 -32
x=((self.width-32) - rect.width*@column_max )/(@column_max+1)
rect.x = index*rect.width + x*(index+1)
rect.y = index / @column_max - 16 +16 #* WLH
return rect
end
#--------------------------------------------------------------------------
# ☆ 項目の描画 <追加変更>
# index : 項目番号
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
#self.contents.clear_rect(rect)
self.contents.font.color = normal_color
actor = $game_party.members[index]
ms=$game_party.members.size
w=96
w=(self.width-32)/ms if ms>4
x=((self.width-32) - w*ms )/(ms+1)
x=0 if x<0
draw_actor_face(actor,actor.index * w + 2 + x*(actor.index+1), 0,w-4) #追加
size = self.contents.font.size #追加
self.contents.font.size=16 #追加
draw_actor_name(actor, actor.index * w + 2 + x*(actor.index+1), 0-4) #追加
draw_actor_state(actor, index*w + x*(actor.index+1), WLH*2 +12, w) #追加
draw_actor_hp(actor, index*w +2 + x*(actor.index+1), WLH*3 +8, w-4) #追加
draw_actor_mp(actor, index*w +2 + x*(actor.index+1), WLH*4 +4, w-4) #追加
self.contents.font.size=size #追加
end
#--------------------------------------------------------------------------
# ☆ 顔グラフィックの描画 <追加変更>
# face_name : 顔グラフィック ファイル名
# face_index : 顔グラフィック インデックス
# x : 描画先 X 座標
# y : 描画先 Y 座標
# size : 表示サイズ
#--------------------------------------------------------------------------
def draw_face(face_name, face_index, x, y, size = 96)
bitmap = Cache.face(face_name)
rect = Rect.new(0, 0, 0, 0)
rect.x = face_index % 4 * 96 + (96 - size) / 2
rect.y = face_index / 4 * 96 #+ (96 - size) / 2#追加
rect.width = size
rect.height = 96 #size#追加
self.contents.blt(x, y, bitmap, rect)
bitmap.dispose
end
#--------------------------------------------------------------------------
# ☆ HP の描画 <追加変更>
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# width : 幅
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 120)
ms = self.contents.font.size/2 #追加
draw_actor_hp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y+2, 30, WLH, Vocab::hp_a) #追加
self.contents.font.color = hp_color(actor)
xr = x + width
if width <90 #追加
self.contents.draw_text(xr - ms*4, y+2, ms*4, WLH, actor.hp, 2) #追加
else
self.contents.draw_text(xr - ms*9, y+2, ms*4, WLH, actor.hp, 2) #追加
self.contents.font.color = normal_color #追加
self.contents.draw_text(xr - ms*5, y+2, ms, WLH, "/", 2) #追加
self.contents.draw_text(xr - ms*4, y+2, ms*4, WLH, actor.maxhp, 2)#追加
end
end
#--------------------------------------------------------------------------
# ☆ MP の描画 <追加変更>
# actor : アクター
# x : 描画先 X 座標
# y : 描画先 Y 座標
# width : 幅
#--------------------------------------------------------------------------
def draw_actor_mp(actor, x, y, width = 120)
ms = self.contents.font.size/2 #追加
draw_actor_mp_gauge(actor, x, y, width)
self.contents.font.color = system_color
self.contents.draw_text(x, y+2, 30, WLH, Vocab::mp_a) #追加
self.contents.font.color = mp_color(actor)
xr = x + width
if width <90 #追加
self.contents.draw_text(xr - ms*4, y+2, ms*4, WLH, actor.mp, 2) #追加
else
self.contents.draw_text(xr - ms*9, y+2, ms*4, WLH, actor.mp, 2) #追加
self.contents.font.color = normal_color #追加
self.contents.draw_text(xr - ms*5, y+2, ms, WLH, "/", 2) #追加
self.contents.draw_text(xr - ms*4, y+2, ms*4, WLH, actor.maxmp, 2)#追加
end
end
end
class Scene_Battle < Scene_Base
#--------------------------------------------------------------------------
# ☆ 対象アクター対象選択の開始 <追加変更>
#--------------------------------------------------------------------------
alias old_start_target_actor_selection start_target_actor_selection
def start_target_actor_selection
old_start_target_actor_selection
@target_actor_window.y -= 16 #追加
end
end
#////////////////////////////////////////////////////////////////
#作成者: ehime
#サイト: 未完のダンボール (Mikan no Danboru)
# URL: http://www.abcoroti.com/~nekoneko/index.html
#readmeやスタッフロールの明記,使用報告は任意.
#////////////////////////////////////////////////////////////////
复制代码
作者:
Rion幻音
时间:
2011-11-4 14:51
推荐我以前写的~~XD
http://rpg.blue/thread-158877-1-1.html
作者:
nozxxx
时间:
2011-11-4 16:03
謝謝了~~~~~~~~
nozxxx于2011-11-4 16:04补充以下内容:
头像不錯吧~~~~~~~~~~~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1