Project1

标题: 如何在窗口界面添加人物经验条? [打印本页]

作者: 捣蛋    时间: 2010-11-9 15:04
标题: 如何在窗口界面添加人物经验条?
本帖最后由 捣蛋 于 2010-11-9 22:21 编辑



我想在这个界面添加人物的经验条.
上面人物等级下面那条是怒气值条.我想在下面添加一条经验值条.
怎么样才能实现?一定要脚本?
作者: summer92    时间: 2010-11-9 15:23
本帖最后由 summer92 于 2010-11-10 11:08 编辑

饿...咱悲剧了,参照下楼 Rion幻音XD
作者: Rion幻音    时间: 2010-11-9 16:33
加下这个……什么都不用改……搞定~
  1. module XRXSVDsIn3
  2.   Width  = 80
  3.   Height =  9
  4.   Color1 = 20
  5.   Color2 = 21
  6. end
  7. class Game_System
  8.   attr_accessor :wide_screen
  9. end
  10. class Window_Base < Window
  11.   def draw_actor_level(actor, x, y)
  12.     if draw_exp_gauge_scene?
  13.       w = XRXSVDsIn3::Width * ($game_system.wide_screen ? 3 : 4) / 4
  14.       draw_actor_exp_gauge(actor, x, y, w)
  15.     else
  16.       w = 24
  17.     end
  18.     self.contents.font.color = system_color
  19.     self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
  20.     self.contents.font.color = normal_color
  21.     self.contents.draw_text(x + 32, y, w - 32, WLH, actor.level, 2)
  22.   end
  23.   def draw_exp_gauge_scene?
  24.     return [Scene_Menu, Scene_Item, Scene_Skill, Scene_Equip].include?($scene.class)
  25.   end
  26.   def draw_actor_exp_gauge(actor, x, y, width = 120)
  27.     gw = width * actor.exp_percent / 100
  28.     gc1 = text_color(XRXSVDsIn3::Color1)
  29.     gc2 = text_color(XRXSVDsIn3::Color2)
  30.     h   = XRXSVDsIn3::Height
  31.     self.contents.fill_rect(x, y + WLH - h - 2, width, h, gauge_back_color)
  32.     self.contents.gradient_fill_rect(x, y + WLH - h - 2, gw, h, gc1, gc2)
  33.   end
  34. end
  35. class Game_Actor < Game_Battler
  36.   def exp_percent
  37.     need_next_level = @exp_list[self.level + 1] - @exp_list[self.level]
  38.     exp_now_level   = @exp - @exp_list[self.level]
  39.     return 100 * exp_now_level / need_next_level
  40.   end
  41. end

复制代码

作者: aa12312300    时间: 2010-11-9 18:06
提示: 作者被禁止或删除 内容自动屏蔽
作者: 捣蛋    时间: 2010-11-9 18:37
回复 Rion幻音 的帖子

修改改显示位置的坐标是改哪行?
我修改了一下的数字...都改不了..应该是我没改对..
修改哪行的数字?
作者: Rion幻音    时间: 2010-11-9 20:46
回复 捣蛋 的帖子

第14行那儿更改……如果要放在怒气下就把y换成y+?(自行设定)
经验条的长度的话就更改第13行为 w = 宽度
作者: 你爹    时间: 2010-11-9 20:54
提示: 作者被禁止或删除 内容自动屏蔽
作者: 捣蛋    时间: 2010-11-9 21:08
感谢大家的帮助..已经修改好了.而已效果很好.
直接上图

第一条是经验条.第二条是怒气值条
作者: 捣蛋    时间: 2010-11-9 22:09
回复 捣蛋 的帖子

这个没有怎么研究...
厄尔尼诺还是一种地理现象呢...只是觉得顺耳就写了上去而已..
现阶段还在弄系统和脚本...剧本没开始..
作者: 632808263    时间: 2010-12-5 09:17
回复 Rion幻音 的帖子

3楼大大, 我贴入你的脚本后 进入游戏 到游戏菜单 时候为什么出现 31行 出错????难道是某个脚本冲突吗??  请帮帮忙啊。。这东西很有用哇!C:\Documents and Settings\Administrator\桌面




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