| 赞 | 91 |
| VIP | |
| 好人卡 | |
| 积分 | 105 |
| 经验 | |
| 最后登录 | 2024-6-24 |
| 在线时间 | 5019 小时 |
无限の剣制
- 梦石
- 0
- 星屑
- 10450
- 在线时间
- 5019 小时
- 注册时间
- 2013-2-28
- 回帖
- 4942
 
|
发表于 2014-12-9 23:41:43
|
显示全部楼层
本帖最后由 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
复制代码 未测试。
[pre lang="ruby" line="1"]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[/pre] |
评分
-
查看全部评分
|