本帖最后由 VIPArcher 于 2014-12-22 15:52 编辑
其实可以自己定义一个这样的绘制特定技能类别的技能的方法。
楼主可以做成这样的菜单,想必是有一定的脚本基础的。那么我就写个代码范例给楼主参考一下吧。- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 绘制指定技能类型的技能
- #--------------------------------------------------------------------------
- def draw_types_skill(actor,stype_id,x,y)
- actor.skills.select{|x| x.stype_id == stype_id}.each do |skill|
- draw_item_name(skill, x, y )
- y += line_height
- end
- end
- end
复制代码 未测试。
class Window_Base < Window #-------------------------------------------------------------------------- # ● 绘制指定技能类型的技能 #-------------------------------------------------------------------------- def draw_types_skill(actor,stype_id,x,y,width = 160, height = line_height) skills = actor.skills.select{|x| x.stype_id == stype_id} skills.each_index do |index| draw_item_name(skills[index], x, y ) rect = Rect.new(x, y, width, height) draw_types_skill_cost(actor,rect, skills[index]) y += height if index % 2 == 1 x = index % 2 == 0 ? width : 0 end end #-------------------------------------------------------------------------- # ● 绘制技能的使用消耗 #-------------------------------------------------------------------------- def draw_types_skill_cost(actor, rect, skill) if actor.skill_tp_cost(skill) > 0 change_color(tp_cost_color) draw_text(rect, actor.skill_tp_cost(skill), 2) elsif actor.skill_mp_cost(skill) > 0 change_color(mp_cost_color) draw_text(rect, actor.skill_mp_cost(skill), 2) end end end
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 绘制指定技能类型的技能
#--------------------------------------------------------------------------
def draw_types_skill(actor,stype_id,x,y,width = 160, height = line_height)
skills = actor.skills.select{|x| x.stype_id == stype_id}
skills.each_index do |index|
draw_item_name(skills[index], x, y )
rect = Rect.new(x, y, width, height)
draw_types_skill_cost(actor,rect, skills[index])
y += height if index % 2 == 1
x = index % 2 == 0 ? width : 0
end
end
#--------------------------------------------------------------------------
# ● 绘制技能的使用消耗
#--------------------------------------------------------------------------
def draw_types_skill_cost(actor, rect, skill)
if actor.skill_tp_cost(skill) > 0
change_color(tp_cost_color)
draw_text(rect, actor.skill_tp_cost(skill), 2)
elsif actor.skill_mp_cost(skill) > 0
change_color(mp_cost_color)
draw_text(rect, actor.skill_mp_cost(skill), 2)
end
end
end
|