Project1

标题: 如何在角色面板中加一条经验槽 [打印本页]

作者: wuchangdao55    时间: 2012-10-22 15:29
标题: 如何在角色面板中加一条经验槽
如题!如何在角色面板中加一条经验槽~!!

要怎么做呢!!??

QQ截图20121022152849.jpg (43.93 KB, 下载次数: 26)

QQ截图20121022152849.jpg

作者: 铅笔描绘的思念    时间: 2012-10-22 15:42
本帖最后由 铅笔描绘的思念 于 2012-10-22 15:59 编辑

编辑以防误人子弟。。。

RUBY 代码复制
  1. class Window_Base < Window
  2.   #追加:EXP颜色
  3.   def exp_gauge_color1;   text_color(28);  end;    # EXP 值槽 1
  4.   def exp_gauge_color2;   text_color(29);  end;    # EXP 值槽 2
  5.   #--------------------------------------------------------------------------
  6.   # ● 绘制 EXP
  7.   #--------------------------------------------------------------------------
  8.   def draw_actor_exp(actor, x, y, width = 120)
  9.     t1 = actor.next_level_exp - actor.current_level_exp - (actor.next_level_exp - actor.current_level_exp)
  10.     t2 = actor.next_level_exp - actor.current_level_exp
  11.     rate = 120 * t1 / t2
  12.     draw_gauge(x, y - 6, width, rate, exp_gauge_color1, exp_gauge_color2)
  13.     change_color(system_color)
  14.     draw_text(x, y, 30, line_height, "EXP")
  15.     draw_text(x + width - 99, y, 44, WLH, actor.exp, 2)
  16.     draw_text(x + width - 36, y, 11, WLH, "/", 2)
  17.     draw_text(x + width - 35, y, 44, WLH, actor.next_level_exp, 2)
  18.   end
  19. end
  20. class Game_Actor < Game_Battler
  21.   def exp_rate
  22.      (exp - current_level_exp) / (next_level_exp - current_level_exp)
  23.   end
  24. end
  25.  
  26. class Window_MenuStatus < Window_Selectable
  27.   #--------------------------------------------------------------------------
  28.   # ● 绘制项目
  29.   #--------------------------------------------------------------------------
  30.   def draw_item(index)
  31.     actor = $game_party.members[index]
  32.     enabled = $game_party.battle_members.include?(actor)
  33.     rect = item_rect(index)
  34.     draw_item_background(index)
  35.     draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
  36.     draw_actor_exp(actor, rect.x + 20, rect.y + 1)
  37.     draw_actor_simple_status(actor, rect.x + 108, rect.y + line_height / 2)
  38.   end
  39. end
搞定坐标调一调
作者: wuchangdao55    时间: 2012-10-22 17:10
要放在哪里呢?


‘‘──wuchangdao55于2012-10-22 17:10补充以下内容:

要放在哪里呢》
’’
作者: fangqing9    时间: 2012-10-22 18:54
http://rpg.blue/thread-252003-1-1.html
可以用这个脚本整合,放在脚本页面的后面
作者: zlpwb1666    时间: 2012-10-23 15:01
LZ问一个问题哈
怎么才能在选项的前面放一个图标呢
作者: q854240045    时间: 2012-10-26 18:50
RUBY 代码复制
  1. #==============================================================================
  2. # F06 - 队伍状态窗口显示改造 - By芙蕾娅
  3. #------------------------------------------------------------------------------
  4. #  ★ - 新增  ☆ - 修改  ■ - 删除 ● - 无变更
  5. #==============================================================================
  6. module Freya
  7.   ExpGaugeColor1 = Color.new(192,128,255)
  8.   ExpGaugeColor2 = Color.new(204,192,255)
  9. end
  10. #==============================================================================
  11. # ■ Window_Base
  12. #------------------------------------------------------------------------------
  13. #  游戏中所有窗口的父类
  14. #==============================================================================
  15. class Window_Base < Window
  16.   #--------------------------------------------------------------------------
  17.   # ● 绘制等级
  18.   #--------------------------------------------------------------------------
  19.   def draw_actor_level(actor, x, y)
  20.     a = actor.next_level_exp - actor.current_level_exp
  21.     b = actor.next_level_exp - actor.exp
  22.     rate = 1 - (b.to_f / a)
  23.     draw_gauge(x, y, 96, rate,Freya::ExpGaugeColor1, Freya::ExpGaugeColor2)
  24.     change_color(system_color)
  25.     draw_text(x, y, 32, line_height, Vocab::level_a)
  26.     change_color(normal_color)
  27.     draw_text(x + 32, y, 24, line_height, actor.level, 2)
  28.   end
  29.   #--------------------------------------------------------------------------
  30.   # ● 绘制简单的状态
  31.   #--------------------------------------------------------------------------
  32.   def draw_actor_simple_status(actor, x, y)
  33.     draw_actor_name(actor, x, y)
  34.     draw_actor_level(actor, x, y + line_height * 1)
  35.     draw_actor_icons(actor, x - 107, y + line_height * 2 + 12)
  36.     draw_actor_class(actor, x + 120, y)
  37.     draw_actor_hp(actor, x + 120, y + line_height * 1)
  38.     draw_actor_mp(actor, x + 120, y + line_height * 2)
  39.   end
  40. end





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1