设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2299|回复: 3
打印 上一主题 下一主题

[已经过期] 关于能力值用槽表示的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
115 小时
注册时间
2010-5-3
帖子
346
跳转到指定楼层
1
发表于 2010-11-2 20:57:30 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 反斗奇彬 于 2010-11-2 21:01 编辑

想把角色的能力值全部用槽来表示,而是是美化的那种,用了天空传说的范例里面的一个脚本,但是除了血槽和魔法槽以外,其他攻击力、防御力的槽表示不出来,脚本在下面,请各位帮忙看看是哪里出现问题(天空传说游戏范例中也是显示不出来),
  1. #==============================================================================
  2. # ■ Window_Base
  3. #------------------------------------------------------------------------------
  4. #  游戏中全部窗口的超级类。
  5. #==============================================================================

  6. class Window_Base < Window
  7.   #--------------------------------------------------------------------------
  8.   # ● 常量
  9.   #--------------------------------------------------------------------------
  10.   WLH = 24                  # 窗口行高(Window Line Height)
  11.   #--------------------------------------------------------------------------
  12.   # ● 初始化对像
  13.   #     x      : 窗口 X 座标
  14.   #     y      : 窗口 Y 座标
  15.   #     width  : 窗口宽度
  16.   #     height : 窗口高度
  17.   #--------------------------------------------------------------------------
  18.   def initialize(x, y, width, height)
  19.     super()
  20.     self.windowskin = Cache.system("Window")
  21.     self.x = x
  22.     self.y = y
  23.     self.width = width
  24.     self.height = height
  25.     self.z = 100
  26.     self.back_opacity = 200
  27.     self.openness = 255
  28.     create_contents
  29.     @opening = false
  30.     @closing = false
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● 释放
  34.   #--------------------------------------------------------------------------
  35.   def dispose
  36.     self.contents.dispose
  37.     super
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● 生成窗口内容
  41.   #--------------------------------------------------------------------------
  42.   def create_contents
  43.     self.contents.dispose
  44.     self.contents = Bitmap.new(width - 32, height - 32)
  45.   end
  46.   #--------------------------------------------------------------------------
  47.   # ● 更新画面
  48.   #--------------------------------------------------------------------------
  49.   def update
  50.     super
  51.     if @opening
  52.       self.openness += 48
  53.       @opening = false if self.openness == 255
  54.     elsif @closing
  55.       self.openness -= 48
  56.       @closing = false if self.openness == 0
  57.     end
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # ● 打开窗口
  61.   #--------------------------------------------------------------------------
  62.   def open
  63.     @opening = true if self.openness < 255
  64.     @closing = false
  65.   end
  66.   #--------------------------------------------------------------------------
  67.   # ● 关闭窗口
  68.   #--------------------------------------------------------------------------
  69.   def close
  70.     @closing = true if self.openness > 0
  71.     @opening = false
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● 获取文字颜色
  75.   #     n : 文字颜色色号(0-31)
  76.   #--------------------------------------------------------------------------
  77.   def text_color(n)
  78.     x = 64 + (n % 8) * 8
  79.     y = 96 + (n / 8) * 8
  80.     return windowskin.get_pixel(x, y)
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ● 获取一般文字颜色
  84.   #--------------------------------------------------------------------------
  85.   def normal_color
  86.     return text_color(0)
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ● 获取系统文字颜色
  90.   #--------------------------------------------------------------------------
  91.   def system_color
  92.     return text_color(16)
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● 获取危机文字颜色
  96.   #--------------------------------------------------------------------------
  97.   def crisis_color
  98.     return text_color(17)
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ● 获取战斗不能文字颜色
  102.   #--------------------------------------------------------------------------
  103.   def knockout_color
  104.     return text_color(18)
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 获取变量条背景颜色
  108.   #--------------------------------------------------------------------------
  109.   def gauge_back_color
  110.     return text_color(19)
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # ● 获取体力值槽颜色1
  114.   #--------------------------------------------------------------------------
  115.   def hp_gauge_color1
  116.     return text_color(20)
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ● 获取体力值槽颜色2
  120.   #--------------------------------------------------------------------------
  121.   def hp_gauge_color2
  122.     return text_color(21)
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ● 获取魔力值槽颜色1
  126.   #--------------------------------------------------------------------------
  127.   def mp_gauge_color1
  128.     return text_color(22)
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # ● 获取魔力值槽颜色2
  132.   #--------------------------------------------------------------------------
  133.   def mp_gauge_color2
  134.     return text_color(23)
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # ● 获取装备画面能力值上升颜色
  138.   #--------------------------------------------------------------------------
  139.   def power_up_color
  140.     return text_color(24)
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● 获取装备画面能力值下降颜色
  144.   #--------------------------------------------------------------------------
  145.   def power_down_color
  146.     return text_color(25)
  147.   end
  148.   #--------------------------------------------------------------------------
  149.   # ☆ 能力值槽颜色1之取得
  150.   #--------------------------------------------------------------------------
  151.   def parameter_gauge_color1
  152.     return text_color(11)
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ☆ 能力值槽颜色2之取得
  156.   #--------------------------------------------------------------------------
  157.   def parameter_gauge_color2
  158.     return text_color(24)
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ☆ EXP值槽颜色1之取得
  162.   #--------------------------------------------------------------------------
  163.   def exp_gauge_color1
  164.     return text_color(30)
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ☆ EXP值槽颜色2之取得
  168.   #--------------------------------------------------------------------------
  169.   def exp_gauge_color2
  170.     return text_color(31)
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # ● 会制图标
  174.   #     icon_index : 图标号
  175.   #     x     : 描画目标 X 坐标
  176.   #     y     : 描画目标 Y 坐标
  177.   #     enabled    : 有效化标志,为 false 时则图标半透明化。
  178.   #--------------------------------------------------------------------------
  179.   def draw_icon(icon_index, x, y, enabled = true)
  180.     bitmap = Cache.system("Iconset")
  181.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  182.     self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● 绘制头像
  186.   #     face_name  : 头像文件名
  187.   #     face_index : 头像号码
  188.   #     x     : 描画目标 X 坐标
  189.   #     y     : 描画目标 Y 坐标
  190.   #     size       : 显示大小
  191.   #--------------------------------------------------------------------------
  192.   def draw_face(face_name, face_index, x, y, size = 96)
  193.     bitmap = Cache.face(face_name)
  194.     rect = Rect.new(0, 0, 0, 0)
  195.     rect.x = face_index % 4 * 96 + (96 - size) / 2
  196.     rect.y = face_index / 4 * 96 + (96 - size) / 2
  197.     rect.width = size
  198.     rect.height = size
  199.     self.contents.blt(x, y, bitmap, rect)
  200.     bitmap.dispose
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● 绘制行走图
  204.   #     character_name  : 行走图文件名
  205.   #     character_index : 行走图号码
  206.   #     x     : 描画目标 X 坐标
  207.   #     y     : 描画目标 Y 坐标
  208.   #--------------------------------------------------------------------------
  209.   def draw_character(character_name, character_index, x, y)
  210.     return if character_name == nil
  211.     bitmap = Cache.character(character_name)
  212.     sign = character_name[/^[\!\$]./]
  213.     if sign != nil and sign.include?('$')
  214.       cw = bitmap.width / 3
  215.       ch = bitmap.height / 4
  216.     else
  217.       cw = bitmap.width / 12
  218.       ch = bitmap.height / 8
  219.     end
  220.     n = character_index
  221.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  222.     self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # ● 获取体力文字颜色
  226.   #     actor : 角色
  227.   #--------------------------------------------------------------------------
  228.   def hp_color(actor)
  229.     return knockout_color if actor.hp == 0
  230.     return crisis_color if actor.hp < actor.maxhp / 4
  231.     return normal_color
  232.   end
  233.   #--------------------------------------------------------------------------
  234.   # ● 获取魔力文字颜色
  235.   #     actor : 角色
  236.   #--------------------------------------------------------------------------
  237.   def mp_color(actor)
  238.     return crisis_color if actor.mp < actor.maxmp / 4
  239.     return normal_color
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # ● 绘制角色行走图
  243.   #     actor : 角色
  244.   #     x     : 描画目标 X 坐标
  245.   #     y     : 描画目标 Y 坐标
  246.   #--------------------------------------------------------------------------
  247.   def draw_actor_graphic(actor, x, y)
  248.     draw_character(actor.character_name, actor.character_index, x, y)
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # ● 绘制角色头像
  252.   #     actor : 角色
  253.   #     x     : 描画目标 X 坐标
  254.   #     y     : 描画目标 Y 坐标
  255.   #     size  : 绘制大小
  256.   #--------------------------------------------------------------------------
  257.   def draw_actor_face(actor, x, y, size = 96)
  258.     draw_face(actor.face_name, actor.face_index, x, y, size)
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # ● 绘制角色名称
  262.   #     actor : 角色
  263.   #     x     : 描画目标 X 坐标
  264.   #     y     : 描画目标 Y 坐标
  265.   #--------------------------------------------------------------------------
  266.   def draw_actor_name(actor, x, y)
  267.     self.contents.font.color = hp_color(actor)
  268.     self.contents.draw_text(x, y, 108, WLH, actor.name)
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● 绘制角色职业
  272.   #     actor : 角色
  273.   #     x     : 描画目标 X 坐标
  274.   #     y     : 描画目标 Y 坐标
  275.   #--------------------------------------------------------------------------
  276.   def draw_actor_class(actor, x, y)
  277.     self.contents.font.color = normal_color
  278.     self.contents.draw_text(x, y, 108, WLH, actor.class.name)
  279.   end
  280.   #--------------------------------------------------------------------------
  281.   # ● 绘制角色等级
  282.   #     actor : 角色
  283.   #     x     : 描画目标 X 坐标
  284.   #     y     : 描画目标 Y 坐标
  285.   #--------------------------------------------------------------------------
  286.   def draw_actor_level(actor, x, y)
  287.     self.contents.font.color = system_color
  288.     self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
  289.     self.contents.font.color = normal_color
  290.     self.contents.draw_text(x + 32, y, 24, WLH, actor.level, 2)
  291.   end
  292.   #--------------------------------------------------------------------------
  293.   # ● 绘制角色状态
  294.   #     actor : 角色
  295.   #     x     : 描画目标 X 坐标
  296.   #     y     : 描画目标 Y 坐标
  297.   #     width : 描画目标宽度
  298.   #--------------------------------------------------------------------------
  299.   def draw_actor_state(actor, x, y, width = 96)
  300.     count = 0
  301.     for state in actor.states
  302.       draw_icon(state.icon_index, x + 24 * count, y)
  303.       count += 1
  304.       break if (24 * count > width - 24)
  305.     end
  306.   end
  307.   #--------------------------------------------------------------------------
  308.   # ● 绘制角色体力
  309.   #     actor : 角色
  310.   #     x     : 描画目标 X 坐标
  311.   #     y     : 描画目标 Y 坐标
  312.   #     width : 描画目标宽度
  313.   #--------------------------------------------------------------------------
  314.   def draw_actor_hp(actor, x, y, width = 120)
  315.     draw_actor_hp_gauge(actor, x, y, width)
  316.     self.contents.font.color = system_color
  317.     self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
  318.     self.contents.font.color = hp_color(actor)
  319.     last_font_size = self.contents.font.size
  320.     xr = x + width
  321.     if width < 120
  322.       self.contents.draw_text(xr - 44, y, 44, WLH, actor.hp, 2)
  323.     else
  324.       self.contents.draw_text(xr - 90, y, 44, WLH, actor.hp, 2)
  325.       self.contents.font.color = normal_color
  326.       self.contents.draw_text(xr - 44, y, 11, WLH, "/ ", 2)
  327.       self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxhp, 2)
  328.     end
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # ● 绘制角色体力值槽
  332.   #     actor : 角色
  333.   #     x     : 描画目标 X 坐标
  334.   #     y     : 描画目标 Y 坐标
  335.   #     width : 描画目标宽度
  336.   #--------------------------------------------------------------------------
  337.    def draw_actor_hp_gauge(actor, x, y, width = 120)
  338.     draw_gauge_base(x, y, width)
  339.     gw = width * actor.hp / actor.maxhp
  340.     gc1 = hp_gauge_color1
  341.     gc2 = hp_gauge_color2
  342.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  343.   end
  344.   #--------------------------------------------------------------------------
  345.   # ● 绘制角色魔力
  346.   #     actor : 角色
  347.   #     x     : 描画目标 X 坐标
  348.   #     y     : 描画目标 Y 坐标
  349.   #     width : 描画目标宽度
  350.   #--------------------------------------------------------------------------
  351.   def draw_actor_mp(actor, x, y, width = 120)
  352.     draw_actor_mp_gauge(actor, x, y, width)
  353.     self.contents.font.color = system_color
  354.     self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a)
  355.     self.contents.font.color = mp_color(actor)
  356.     last_font_size = self.contents.font.size
  357.     xr = x + width
  358.     if width < 120
  359.       self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2)
  360.     else
  361.       self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2)
  362.       self.contents.font.color = normal_color
  363.       self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
  364.       self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 2)
  365.     end
  366.   end
  367.   #--------------------------------------------------------------------------
  368.   # ● 绘制角色魔力值槽
  369.   #     actor : 角色
  370.   #     x     : 描画目标 X 坐标
  371.   #     y     : 描画目标 Y 坐标
  372.   #     width : 描画目标宽度
  373.   #--------------------------------------------------------------------------
  374. def draw_actor_mp_gauge(actor, x, y, width = 120)
  375.     draw_gauge_base(x, y, width)
  376.     gw = width * actor.mp / [actor.maxmp, 1].max
  377.     gc1 = mp_gauge_color1
  378.     gc2 = mp_gauge_color2
  379.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  380.   end
  381.   #--------------------------------------------------------------------------
  382.   # ☆ 值槽底板描绘
  383.   #     type  : HP (0) MP (1)
  384.   #     x     : 描画目标 X 坐标
  385.   #     y     : 描画目标 Y 坐标
  386.   #     width : 描画目标宽度
  387.   #--------------------------------------------------------------------------
  388.   def draw_gauge_base(x, y, width = 120)
  389.     bitmap = Cache.system("gauge")
  390.     margin = 3
  391.     y += WLH - 8 - margin
  392.     dest_rect = Rect.new(x, y, width, bitmap.height)
  393.     src_rect = Rect.new(margin, 0, bitmap.width - 16, bitmap.height)
  394.     self.contents.stretch_blt(dest_rect, bitmap, src_rect)
  395.     src_rect = Rect.new(0, 0, margin, bitmap.height)
  396.     self.contents.blt(x - margin, y, bitmap, src_rect)
  397.     src_rect = Rect.new(bitmap.width - margin, 0, margin, bitmap.height)
  398.     self.contents.blt(x + width, y, bitmap, src_rect)
  399.   end
  400.   #--------------------------------------------------------------------------
  401.   # ☆ ATK值槽描画
  402.   #     type  : HP (0) MP (1)
  403.   #     x     : 描画目标 X 坐标
  404.   #     y     : 描画目标 Y 坐标
  405.   #     width : 描画目标宽度
  406.   #--------------------------------------------------------------------------
  407.   def draw_actor_atk_gauge(actor, x, y, width = 120)
  408.     draw_gauge_base(x, y, width)
  409.     max = 800
  410.     gw = width * actor.atk / max
  411.     gc1 = parameter_gauge_color1
  412.     gc2 = parameter_gauge_color2
  413.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  414.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # ☆ DEF值槽描画
  418.   #     type  : HP (0) MP (1)
  419.   #     x     : 描画目标 X 坐标
  420.   #     y     : 描画目标 Y 坐标
  421.   #     width : 描画目标宽度
  422.   #--------------------------------------------------------------------------
  423.   def draw_actor_def_gauge(actor, x, y, width = 120)
  424.     draw_gauge_base(x, y, width)
  425.     max = 800
  426.     gw = width * actor.def / max
  427.     gc1 = parameter_gauge_color1
  428.     gc2 = parameter_gauge_color2
  429.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  430.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  431.   end
  432.   #--------------------------------------------------------------------------
  433.   # ☆ SPI值槽描画
  434.   #     type  : HP (0) MP (1)
  435.   #     x     : 描画目标 X 坐标
  436.   #     y     : 描画目标 Y 坐标
  437.   #     width : 描画目标宽度
  438.   #--------------------------------------------------------------------------
  439.   def draw_actor_spi_gauge(actor, x, y, width = 120)
  440.     draw_gauge_base(x, y, width)
  441.     max = 800
  442.     gw = width * actor.spi / max
  443.     gc1 = parameter_gauge_color1
  444.     gc2 = parameter_gauge_color2
  445.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  446.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # ☆ AGI值槽描画
  450.   #     type  : HP (0) MP (1)
  451.   #     x     : 描画目标 X 坐标
  452.   #     y     : 描画目标 Y 坐标
  453.   #     width : 描画目标宽度
  454.   #--------------------------------------------------------------------------
  455.   def draw_actor_agi_gauge(actor, x, y, width = 120)
  456.     draw_gauge_base(x, y, width)
  457.     max = 800
  458.     gw = width * actor.agi / max
  459.     gc1 = parameter_gauge_color1
  460.     gc2 = parameter_gauge_color2
  461.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  462.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  463.   end
  464.   #--------------------------------------------------------------------------
  465.   # ☆ HIT值槽描画
  466.   #     type  : HP (0) MP (1)
  467.   #     x     : 描画目标 X 坐标
  468.   #     y     : 描画目标 Y 坐标
  469.   #     width : 描画目标宽度
  470.   #--------------------------------------------------------------------------
  471.   def draw_actor_hit_gauge(actor, x, y, width = 120)
  472.     draw_gauge_base(x, y, width)
  473.     max = 800
  474.     gw = width * actor.hit / max
  475.     gc1 = parameter_gauge_color1
  476.     gc2 = parameter_gauge_color2
  477.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  478.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  479.   end
  480.   #--------------------------------------------------------------------------
  481.   # ☆ EVA值槽描画
  482.   #     type  : HP (0) MP (1)
  483.   #     x     : 描画目标 X 坐标
  484.   #     y     : 描画目标 Y 坐标
  485.   #     width : 描画目标宽度
  486.   #--------------------------------------------------------------------------
  487.   def draw_actor_eva_gauge(actor, x, y, width = 120)
  488.     draw_gauge_base(x, y, width)
  489.     max = 75
  490.     gw = width * actor.eva / max
  491.     gc1 = parameter_gauge_color1
  492.     gc2 = parameter_gauge_color2
  493.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  494.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # ☆ CRI值槽描画
  498.   #     type  : HP (0) MP (1)
  499.   #     x     : 描画目标 X 坐标
  500.   #     y     : 描画目标 Y 坐标
  501.   #     width : 描画目标宽度
  502.   #--------------------------------------------------------------------------
  503.   def draw_actor_cri_gauge(actor, x, y, width = 120)
  504.     draw_gauge_base(x, y, width)
  505.     max = 75
  506.     gw = width * actor.cri / max
  507.     gc1 = parameter_gauge_color1
  508.     gc2 = parameter_gauge_color2
  509.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  510.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  511.   end
  512.   
  513.   #--------------------------------------------------------------------------
  514.   # ● EXP情报描画
  515.   #     x     : 描画目标 X 坐标
  516.   #     y     : 描画目标 Y 坐标
  517.   #--------------------------------------------------------------------------
  518.   def draw_exp_info_GS(actor, x, y, width = 120)
  519.     s1 = actor.exp_s
  520.     s2 = actor.next_rest_exp_s
  521.     xr = x + width
  522.     draw_actor_exp_gauge(actor, x, y, width)
  523.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  524.     self.contents.font.color = system_color
  525.     self.contents.draw_text(x, y, 60, WLH, "NEXT")
  526.     self.contents.font.color = normal_color
  527.     self.contents.draw_text(x, y, width, WLH, s2, 2)
  528.   end
  529.   #--------------------------------------------------------------------------
  530.   # ● EXP值槽描画
  531.   #     actor : 角色
  532.   #     x     : 描画目标 X 坐标
  533.   #     y     : 描画目标 Y 坐标
  534.   #     width : 描画目标宽度
  535.   #--------------------------------------------------------------------------
  536.   def draw_actor_exp_gauge(actor, x, y, width = 120)
  537.     draw_gauge_base(x, y, width)
  538.     max = actor.next_max_exp
  539.     gw = width * (max - actor.next_rest_exp) / max
  540.     gc1 = exp_gauge_color1
  541.     gc2 = exp_gauge_color2
  542.     self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  543.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  544.   end
  545.   #--------------------------------------------------------------------------
  546.   # ● 绘制角色能力值
  547.   #     actor : 角色
  548.   #     x     : 描画目标 X 坐标
  549.   #     y     : 描画目标 Y 坐标
  550.   #     type  : 能力值类型(0-3)
  551.   #--------------------------------------------------------------------------
  552.   def draw_actor_parameter(actor, x, y, type)
  553.     case type
  554.     when 0
  555.       parameter_name = Vocab::atk
  556.       parameter_value = actor.atk
  557.     when 1
  558.       parameter_name = Vocab::def
  559.       parameter_value = actor.def
  560.     when 2
  561.       parameter_name = Vocab::spi
  562.       parameter_value = actor.spi
  563.     when 3
  564.       parameter_name = Vocab::agi
  565.       parameter_value = actor.agi
  566. #------------------------------------------------------添加
  567.     when 4
  568.       parameter_name ="命中"
  569.       parameter_value = actor.hit
  570.     when 5
  571.       parameter_name = "回避修正"
  572.       parameter_value = actor.eva
  573.     when 6
  574.       parameter_name = "要害修正"
  575.       parameter_value = actor.cri
  576. #------------------------------------------------------添加
  577.     end
  578.    
  579.      self.contents.font.color = system_color
  580.      self.contents.draw_text(12, y, 120, WLH, parameter_name)
  581.      self.contents.font.color = normal_color
  582.      self.contents.draw_text(60, y, 36, WLH, parameter_value, 2)
  583.    end
  584.    def draw_system_text(x, y, width, height, str, align = 0, size = 20)
  585.     self.contents.font.color = system_color
  586.     self.contents.font.size = size
  587.     self.contents.draw_text(x, y, width, height, str, align)
  588.     self.contents.font.color = normal_color
  589.     self.contents.font.size = 20
  590.   end
  591.   #--------------------------------------------------------------------------
  592.   # ● 绘制物品
  593.   #     item    : 物品(技能、武器、防具也合用)
  594.   #     x       : 描画目标 X 坐标
  595.   #     y       : 描画目标 Y 坐标
  596.   #     enabled : 有效化标志,为 false 时则物品半透明化。
  597.   #--------------------------------------------------------------------------
  598.   def draw_item_name(item, x, y, enabled = true)
  599.     if item != nil
  600.       draw_icon(item.icon_index, x, y, enabled)
  601.       self.contents.font.color = normal_color
  602.       self.contents.font.color.alpha = enabled ? 255 : 128
  603.       self.contents.draw_text(x + 24, y, 172, WLH, item.name)
  604.     end
  605.   end
  606.   
  607.   #--------------------------------------------------------------------------
  608.   # ● 绘制金钱单位
  609.   #     value : 数目
  610.   #     x     : 描画目标 X 坐标
  611.   #     y     : 描画目标 Y 坐标
  612.   #     width : 描画目标宽度
  613.   #--------------------------------------------------------------------------
  614.   def draw_currency_value(value, x, y, width)
  615.     cx = contents.text_size(Vocab::gold).width
  616.     self.contents.font.color = normal_color
  617.     self.contents.draw_text(x, y, width-cx-2, WLH, value, 2)
  618.     self.contents.font.color = system_color
  619.     self.contents.draw_text(x, y, width, WLH, Vocab::gold, 2)
  620.   end
  621. end
复制代码
就是

现实状态.jpg (43.52 KB, 下载次数: 20)

现实状态.jpg

理想状态.png (141.82 KB, 下载次数: 15)

理想状态.png

Lv1.梦旅人

梦石
0
星屑
50
在线时间
72 小时
注册时间
2010-10-18
帖子
104
2
发表于 2010-11-2 21:12:52 | 只看该作者
你在menustatus中要调用啊……
把function写好但不调用还是白搭啊

点评

还是不知道怎么弄,头晕  发表于 2010-11-3 00:19
没喔 你仔细去看脚本 在draw_actor_parameter时完全没调用draw_actor_atk_gauge等function 最好检查下你的status脚本中有没调用 没调用当然不会出现gauge了  发表于 2010-11-2 23:22
其实在调用攻击力、防御力的数值时应该也一同调用了,难道还要怎么特别修改吗?  发表于 2010-11-2 23:17
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
115 小时
注册时间
2010-5-3
帖子
346
3
 楼主| 发表于 2010-11-2 21:34:27 | 只看该作者
回复 迷路子 的帖子

在menustatus调用?不是应该在Window_Status添加吗?我只要在状态画面能显示值槽的

点评

汗 一不小心口误了 是在status加才对 你如果有调用应该是会显示的  发表于 2010-11-2 23:13
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
115 小时
注册时间
2010-5-3
帖子
346
4
 楼主| 发表于 2010-11-10 11:15:35 | 只看该作者
其实,这个问题很多人都遇到吧,为什么没人帮我啊
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-26 16:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表