赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1689 |
最后登录 | 2019-11-8 |
在线时间 | 231 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 75
- 在线时间
- 231 小时
- 注册时间
- 2014-10-5
- 帖子
- 296
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
RT,就是我自己修改了一下战斗状态栏,加入了自制HP条与脸图,
可是我想设置一个6人战斗的时候,发现屏幕放不下,下面有截图,
就是说,让状态栏现实 480的宽度,每一个人物占用80的
下面是脚本
#encoding:utf-8 #============================================================================== # ■ Window_BattleStatus #------------------------------------------------------------------------------ # 战斗画面中,显示“队伍成员状态”的窗口。 #============================================================================== class Window_BattleStatus < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize super(0, 10, window_width, window_height) refresh self.openness = 0 self.z=2 end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width Graphics.width #- 128 end #-------------------------------------------------------------------------- # ● 获取窗口的高度 #-------------------------------------------------------------------------- def window_height fitting_height(4) end #-------------------------------------------------------------------------- # ● 获取项目数 #-------------------------------------------------------------------------- def item_max $game_party.battle_members.size end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh contents.clear draw_all_items end #-------------------------------------------------------------------------- # ● 描绘项目 #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) rect.x += 4 rect.width -= 50#10 self.contents.clear_rect(rect) self.contents.font.color = normal_color actor = $game_party.members[index] draw_actor_face(actor, rect.x-10 , rect.y-20 )#,rect.width - 50) #draw_actor_name(actor, index * 100, rect.y + 2) #draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104) draw_actor_icons(actor, index * 100 + 6, 22, 24) draw_crhp(rect.x,rect.y+52,actor.hp,actor.mhp,"") draw_crmp(rect.x,rect.y+68,actor.mp,actor.mmp,"") draw_actor_tp(actor, index * 100, 60, 70) end #---------------------------------------------------------------------- # ● 设置光标的位置 # index : 新的光标位置 #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor refresh end #-------------------------------------------------------------------------- # ● 获取项目描画矩形 # index : 项目编号 #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = contents.width - 113 rect.height = 20 rect.x = index * 100 rect.y = 0 return rect end #-------------------------------------------------------------------------- # ● 更新光标矩形 #-------------------------------------------------------------------------- def update_cursor case @index when 0...6 self.cursor_rect.set(@index * 100, 0, 80, 96) else self.cursor_rect.empty # 光标无效 end end end
#encoding:utf-8
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 战斗画面中,显示“队伍成员状态”的窗口。
#==============================================================================
class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(0, 10, window_width, window_height)
refresh
self.openness = 0
self.z=2
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
Graphics.width #- 128
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
fitting_height(4)
end
#--------------------------------------------------------------------------
# ● 获取项目数
#--------------------------------------------------------------------------
def item_max
$game_party.battle_members.size
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_all_items
end
#--------------------------------------------------------------------------
# ● 描绘项目
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
rect.x += 4
rect.width -= 50#10
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
actor = $game_party.members[index]
draw_actor_face(actor, rect.x-10 , rect.y-20 )#,rect.width - 50)
#draw_actor_name(actor, index * 100, rect.y + 2)
#draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104)
draw_actor_icons(actor, index * 100 + 6, 22, 24)
draw_crhp(rect.x,rect.y+52,actor.hp,actor.mhp,"")
draw_crmp(rect.x,rect.y+68,actor.mp,actor.mmp,"")
draw_actor_tp(actor, index * 100, 60, 70)
end
#----------------------------------------------------------------------
# ● 设置光标的位置
# index : 新的光标位置
#--------------------------------------------------------------------------
def index=(index)
@index = index
update_cursor
refresh
end
#--------------------------------------------------------------------------
# ● 获取项目描画矩形
# index : 项目编号
#--------------------------------------------------------------------------
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = contents.width - 113
rect.height = 20
rect.x = index * 100
rect.y = 0
return rect
end
#--------------------------------------------------------------------------
# ● 更新光标矩形
#--------------------------------------------------------------------------
def update_cursor
case @index
when 0...6
self.cursor_rect.set(@index * 100, 0, 80, 96)
else
self.cursor_rect.empty # 光标无效
end
end
end
|
|