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

Project1

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

[已经过期] 进行战斗提示Window_Base脚本有误,求教

[复制链接]

Lv1.梦旅人

梦石
0
星屑
795
在线时间
4 小时
注册时间
2015-6-7
帖子
2
跳转到指定楼层
1
发表于 2015-6-8 17:05:32 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
对脚本不了解,就改了个菜单加了个计时器
然后再测试发现不能战斗了,如图提示


提示错误的是这里
RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2.   # ● 绘制强化/弱化状态的图标
  3.   #--------------------------------------------------------------------------
  4.   def draw_actor_icons(actor, x, y, width = 96)
  5.     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  6.     icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, y) }
  7.   end


Window_Base脚本应该没动过的
RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Window_Base
  4. #------------------------------------------------------------------------------
  5. #  游戏中所有窗口的父类
  6. #==============================================================================
  7.  
  8. class Window_Base < Window
  9.   #--------------------------------------------------------------------------
  10.   # ● 初始化对象
  11.   #--------------------------------------------------------------------------
  12.   def initialize(x, y, width, height)
  13.     super
  14.     self.windowskin = Cache.system("Window")
  15.     update_padding
  16.     update_tone
  17.     create_contents
  18.     @opening = @closing = false
  19.   end
  20.   #--------------------------------------------------------------------------
  21.   # ● 释放
  22.   #--------------------------------------------------------------------------
  23.   def dispose
  24.     contents.dispose unless disposed?
  25.     super
  26.   end
  27.   #--------------------------------------------------------------------------
  28.   # ● 获取行高
  29.   #--------------------------------------------------------------------------
  30.   def line_height
  31.     return 24
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   # ● 获取标准的边距尺寸
  35.   #--------------------------------------------------------------------------
  36.   def standard_padding
  37.     return 12
  38.   end
  39.   #--------------------------------------------------------------------------
  40.   # ● 更新边距
  41.   #--------------------------------------------------------------------------
  42.   def update_padding
  43.     self.padding = standard_padding
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 计算窗口内容的宽度
  47.   #--------------------------------------------------------------------------
  48.   def contents_width
  49.     width - standard_padding * 2
  50.   end
  51.   #--------------------------------------------------------------------------
  52.   # ● 计算窗口内容的高度
  53.   #--------------------------------------------------------------------------
  54.   def contents_height
  55.     height - standard_padding * 2
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # ● 计算窗口显示指定行数时的应用高度
  59.   #--------------------------------------------------------------------------
  60.   def fitting_height(line_number)
  61.     line_number * line_height + standard_padding * 2
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● 更新色调
  65.   #--------------------------------------------------------------------------
  66.   def update_tone
  67.     self.tone.set($game_system.window_tone)
  68.   end
  69.   #--------------------------------------------------------------------------
  70.   # ● 生成窗口内容
  71.   #--------------------------------------------------------------------------
  72.   def create_contents
  73.     contents.dispose
  74.     if contents_width > 0 && contents_height > 0
  75.       self.contents = Bitmap.new(contents_width, contents_height)
  76.     else
  77.       self.contents = Bitmap.new(1, 1)
  78.     end
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # ● 更新画面
  82.   #--------------------------------------------------------------------------
  83.   def update
  84.     super
  85.     update_tone
  86.     update_open if @opening
  87.     update_close if @closing
  88.   end
  89.   #--------------------------------------------------------------------------
  90.   # ● 更新打开处理
  91.   #--------------------------------------------------------------------------
  92.   def update_open
  93.     self.openness += 48
  94.     @opening = false if open?
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● 更新关闭处理
  98.   #--------------------------------------------------------------------------
  99.   def update_close
  100.     self.openness -= 48
  101.     @closing = false if close?
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   # ● 打开窗口
  105.   #--------------------------------------------------------------------------
  106.   def open
  107.     @opening = true unless open?
  108.     @closing = false
  109.     self
  110.   end
  111.   #--------------------------------------------------------------------------
  112.   # ● 关闭窗口
  113.   #--------------------------------------------------------------------------
  114.   def close
  115.     @closing = true unless close?
  116.     @opening = false
  117.     self
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # ● 显示窗口
  121.   #--------------------------------------------------------------------------
  122.   def show
  123.     self.visible = true
  124.     self
  125.   end
  126.   #--------------------------------------------------------------------------
  127.   # ● 隐藏窗口
  128.   #--------------------------------------------------------------------------
  129.   def hide
  130.     self.visible = false
  131.     self
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● 启用窗口
  135.   #--------------------------------------------------------------------------
  136.   def activate
  137.     self.active = true
  138.     self
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # ● 冻结窗口
  142.   #--------------------------------------------------------------------------
  143.   def deactivate
  144.     self.active = false
  145.     self
  146.   end
  147.   #--------------------------------------------------------------------------
  148.   # ● 获取文字颜色
  149.   #     n : 文字颜色编号(0..31)
  150.   #--------------------------------------------------------------------------
  151.   def text_color(n)
  152.     windowskin.get_pixel(64 + (n % 8) * 8, 96 + (n / 8) * 8)
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ● 获取各种文字颜色
  156.   #--------------------------------------------------------------------------
  157.   def normal_color;      text_color(0);   end;    # 普通
  158.   def system_color;      text_color(16);  end;    # 系统
  159.   def crisis_color;      text_color(17);  end;    # 危险
  160.   def knockout_color;    text_color(18);  end;    # 无法战斗
  161.   def gauge_back_color;  text_color(19);  end;    # 值槽背景
  162.   def hp_gauge_color1;   text_color(20);  end;    # HP 值槽 1
  163.   def hp_gauge_color2;   text_color(21);  end;    # HP 值槽 2
  164.   def mp_gauge_color1;   text_color(22);  end;    # MP 值槽 1
  165.   def mp_gauge_color2;   text_color(23);  end;    # MP 值槽 2
  166.   def mp_cost_color;     text_color(23);  end;    # 消费 TP
  167.   def power_up_color;    text_color(24);  end;    # 能力值提升(更换装备时)
  168.   def power_down_color;  text_color(25);  end;    # 能力值降低(更换装备时)
  169.   def tp_gauge_color1;   text_color(28);  end;    # TP 值槽 1
  170.   def tp_gauge_color2;   text_color(29);  end;    # TP 值槽 2
  171.   def tp_cost_color;     text_color(29);  end;    # 消费 TP
  172.   #--------------------------------------------------------------------------
  173.   # ● 获取保留项目的背景色
  174.   #--------------------------------------------------------------------------
  175.   def pending_color
  176.     windowskin.get_pixel(80, 80)
  177.   end
  178.   #--------------------------------------------------------------------------
  179.   # ● 获取半透明绘制用的透明度
  180.   #--------------------------------------------------------------------------
  181.   def translucent_alpha
  182.     return 160
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # ● 更改内容绘制颜色
  186.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  187.   #--------------------------------------------------------------------------
  188.   def change_color(color, enabled = true)
  189.     contents.font.color.set(color)
  190.     contents.font.color.alpha = translucent_alpha unless enabled
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ● 绘制内容
  194.   #     args : 与 Bitmap#draw_text 相同
  195.   #--------------------------------------------------------------------------
  196.   def draw_text(*args)
  197.     contents.draw_text(*args)
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # ● 获取内容尺寸
  201.   #--------------------------------------------------------------------------
  202.   def text_size(str)
  203.     contents.text_size(str)
  204.   end
  205.   #--------------------------------------------------------------------------
  206.   # ● 绘制带有控制符的文本内容
  207.   #--------------------------------------------------------------------------
  208.   def draw_text_ex(x, y, text)
  209.     reset_font_settings
  210.     text = convert_escape_characters(text)
  211.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  212.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  213.   end
  214.   #--------------------------------------------------------------------------
  215.   # ● 重置字体设置
  216.   #--------------------------------------------------------------------------
  217.   def reset_font_settings
  218.     change_color(normal_color)
  219.     contents.font.size = Font.default_size
  220.     contents.font.bold = false
  221.     contents.font.italic = false
  222.   end
  223.   #--------------------------------------------------------------------------
  224.   # ● 进行控制符的事前变换
  225.   #    在实际绘制前、将控制符替换为实际的内容。
  226.   #    为了减少歧异,文字「\」会被首先替换为转义符(\e)。
  227.   #--------------------------------------------------------------------------
  228.   def convert_escape_characters(text)
  229.     result = text.to_s.clone
  230.     result.gsub!(/\\/)            { "\e" }
  231.     result.gsub!(/\e\e/)          { "\\" }
  232.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  233.     result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }
  234.     result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }
  235.     result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }
  236.     result.gsub!(/\eG/i)          { Vocab::currency_unit }
  237.     result
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● 获取第 n 号角色的名字
  241.   #--------------------------------------------------------------------------
  242.   def actor_name(n)
  243.     actor = n >= 1 ? $game_actors[n] : nil
  244.     actor ? actor.name : ""
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● 获取第 n 号队伍成员的名字
  248.   #--------------------------------------------------------------------------
  249.   def party_member_name(n)
  250.     actor = n >= 1 ? $game_party.members[n - 1] : nil
  251.     actor ? actor.name : ""
  252.   end
  253.   #--------------------------------------------------------------------------
  254.   # ● 文字的处理
  255.   #     c    : 文字
  256.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  257.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  258.   #--------------------------------------------------------------------------
  259.   def process_character(c, text, pos)
  260.     case c
  261.     when "\r"   # 回车
  262.       return
  263.     when "\n"   # 换行
  264.       process_new_line(text, pos)
  265.     when "\f"   # 翻页
  266.       process_new_page(text, pos)
  267.     when "\e"   # 控制符
  268.       process_escape_character(obtain_escape_code(text), text, pos)
  269.     else        # 普通文字
  270.       process_normal_character(c, pos)
  271.     end
  272.   end
  273.   #--------------------------------------------------------------------------
  274.   # ● 处理普通文字
  275.   #--------------------------------------------------------------------------
  276.   def process_normal_character(c, pos)
  277.     text_width = text_size(c).width
  278.     draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
  279.     pos[:x] += text_width
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● 处理换行文字
  283.   #--------------------------------------------------------------------------
  284.   def process_new_line(text, pos)
  285.     pos[:x] = pos[:new_x]
  286.     pos[:y] += pos[:height]
  287.     pos[:height] = calc_line_height(text)
  288.   end
  289.   #--------------------------------------------------------------------------
  290.   # ● 处理翻页文字
  291.   #--------------------------------------------------------------------------
  292.   def process_new_page(text, pos)
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● 获取控制符的实际形式(这个方法会破坏原始数据)
  296.   #--------------------------------------------------------------------------
  297.   def obtain_escape_code(text)
  298.     text.slice!(/^[\$\.\|\^!><\{\}\\]|^[A-Z]+/i)
  299.   end
  300.   #--------------------------------------------------------------------------
  301.   # ● 获取控制符的参数(这个方法会破坏原始数据)
  302.   #--------------------------------------------------------------------------
  303.   def obtain_escape_param(text)
  304.     text.slice!(/^\[\d+\]/)[/\d+/].to_i rescue 0
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # ● 控制符的处理
  308.   #     code : 控制符的实际形式(比如“\C[1]”是“C”)
  309.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  310.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  311.   #--------------------------------------------------------------------------
  312.   def process_escape_character(code, text, pos)
  313.     case code.upcase
  314.     when 'C'
  315.       change_color(text_color(obtain_escape_param(text)))
  316.     when 'I'
  317.       process_draw_icon(obtain_escape_param(text), pos)
  318.     when '{'
  319.       make_font_bigger
  320.     when '}'
  321.       make_font_smaller
  322.     end
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # ● 处理控制符指定的图标绘制
  326.   #--------------------------------------------------------------------------
  327.   def process_draw_icon(icon_index, pos)
  328.     draw_icon(icon_index, pos[:x], pos[:y])
  329.     pos[:x] += 24
  330.   end
  331.   #--------------------------------------------------------------------------
  332.   # ● 放大字体尺寸
  333.   #--------------------------------------------------------------------------
  334.   def make_font_bigger
  335.     contents.font.size += 8 if contents.font.size <= 64
  336.   end
  337.   #--------------------------------------------------------------------------
  338.   # ● 缩小字体尺寸
  339.   #--------------------------------------------------------------------------
  340.   def make_font_smaller
  341.     contents.font.size -= 8 if contents.font.size >= 16
  342.   end
  343.   #--------------------------------------------------------------------------
  344.   # ● 计算行高
  345.   #     restore_font_size : 计算完成后是否恢复原本的字体尺寸?
  346.   #--------------------------------------------------------------------------
  347.   def calc_line_height(text, restore_font_size = true)
  348.     result = [line_height, contents.font.size].max
  349.     last_font_size = contents.font.size
  350.     text.slice(/^.*$/).scan(/\e[\{\}]/).each do |esc|
  351.       make_font_bigger  if esc == "\e{"
  352.       make_font_smaller if esc == "\e}"
  353.       result = [result, contents.font.size].max
  354.     end
  355.     contents.font.size = last_font_size if restore_font_size
  356.     result
  357.   end
  358.   #--------------------------------------------------------------------------
  359.   # ● 绘制值槽
  360.   #     rate   : 比率(1.0 为满值)
  361.   #     color1 : 渐变色的左端
  362.   #     color2 : 渐变色的右端
  363.   #--------------------------------------------------------------------------
  364.   def draw_gauge(x, y, width, rate, color1, color2)
  365.     fill_w = (width * rate).to_i
  366.     gauge_y = y + line_height - 8
  367.     contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
  368.     contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
  369.   end
  370.   #--------------------------------------------------------------------------
  371.   # ● 绘制图标
  372.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  373.   #--------------------------------------------------------------------------
  374.   def draw_icon(icon_index, x, y, enabled = true)
  375.     bitmap = Cache.system("Iconset")
  376.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  377.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  378.   end
  379.   #--------------------------------------------------------------------------
  380.   # ● 绘制角色肖像图
  381.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  382.   #--------------------------------------------------------------------------
  383.   def draw_face(face_name, face_index, x, y, enabled = true)
  384.     bitmap = Cache.face(face_name)
  385.     rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
  386.     contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
  387.     bitmap.dispose
  388.   end
  389.   #--------------------------------------------------------------------------
  390.   # ● 绘制人物行走图
  391.   #--------------------------------------------------------------------------
  392.   def draw_character(character_name, character_index, x, y)
  393.     return unless character_name
  394.     bitmap = Cache.character(character_name)
  395.     sign = character_name[/^[\!\$]./]
  396.     if sign && sign.include?('$')
  397.       cw = bitmap.width / 3
  398.       ch = bitmap.height / 4
  399.     else
  400.       cw = bitmap.width / 12
  401.       ch = bitmap.height / 8
  402.     end
  403.     n = character_index
  404.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  405.     contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  406.   end
  407.   #--------------------------------------------------------------------------
  408.   # ● 获取 HP 的文字颜色
  409.   #--------------------------------------------------------------------------
  410.   def hp_color(actor)
  411.     return knockout_color if actor.hp == 0
  412.     return crisis_color if actor.hp < actor.mhp / 4
  413.     return normal_color
  414.   end
  415.   #--------------------------------------------------------------------------
  416.   # ● 获取 MP 的文字颜色
  417.   #--------------------------------------------------------------------------
  418.   def mp_color(actor)
  419.     return crisis_color if actor.mp < actor.mmp / 4
  420.     return normal_color
  421.   end
  422.   #--------------------------------------------------------------------------
  423.   # ● 获取 TP 的文字颜色
  424.   #--------------------------------------------------------------------------
  425.   def tp_color(actor)
  426.     return normal_color
  427.   end
  428.   #--------------------------------------------------------------------------
  429.   # ● 绘制角色行走图
  430.   #--------------------------------------------------------------------------
  431.   def draw_actor_graphic(actor, x, y)
  432.     draw_character(actor.character_name, actor.character_index, x, y)
  433.   end
  434.   #--------------------------------------------------------------------------
  435.   # ● 绘制角色肖像图
  436.   #--------------------------------------------------------------------------
  437.   def draw_actor_face(actor, x, y, enabled = true)
  438.     draw_face(actor.face_name, actor.face_index, x, y, enabled)
  439.   end
  440.   #--------------------------------------------------------------------------
  441.   # ● 绘制名字
  442.   #--------------------------------------------------------------------------
  443.   def draw_actor_name(actor, x, y, width = 112)
  444.     change_color(hp_color(actor))
  445.     draw_text(x, y, width, line_height, actor.name)
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # ● 绘制职业
  449.   #--------------------------------------------------------------------------
  450.   def draw_actor_class(actor, x, y, width = 112)
  451.     change_color(normal_color)
  452.     draw_text(x, y, width, line_height, actor.class.name)
  453.   end
  454.   #--------------------------------------------------------------------------
  455.   # ● 绘制称号
  456.   #--------------------------------------------------------------------------
  457.   def draw_actor_nickname(actor, x, y, width = 180)
  458.     change_color(normal_color)
  459.     draw_text(x, y, width, line_height, actor.nickname)
  460.   end
  461.   #--------------------------------------------------------------------------
  462.   # ● 绘制等级
  463.   #--------------------------------------------------------------------------
  464.   def draw_actor_level(actor, x, y)
  465.     change_color(system_color)
  466.     draw_text(x, y, 32, line_height, Vocab::level_a)
  467.     change_color(normal_color)
  468.     draw_text(x + 32, y, 24, line_height, actor.level, 2)
  469.   end
  470.   #--------------------------------------------------------------------------
  471.   # ● 绘制强化/弱化状态的图标
  472.   #--------------------------------------------------------------------------
  473.   def draw_actor_icons(actor, x, y, width = 96)
  474.     icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
  475.     icons.each_with_index {|n, i| draw_icon(n, x + 24 * i, y) }
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # ● 以 当前值/最大值 这样的分数形式绘制当前值和最大值
  479.   #     current : 当前值
  480.   #     max     : 最大值
  481.   #     color1  : 当前值的颜色
  482.   #     color2  : 最大值的颜色
  483.   #--------------------------------------------------------------------------
  484.   def draw_current_and_max_values(x, y, width, current, max, color1, color2)
  485.     change_color(color1)
  486.     xr = x + width
  487.     if width < 96
  488.       draw_text(xr - 40, y, 42, line_height, current, 2)
  489.     else
  490.       draw_text(xr - 92, y, 42, line_height, current, 2)
  491.       change_color(color2)
  492.       draw_text(xr - 52, y, 12, line_height, "/", 2)
  493.       draw_text(xr - 42, y, 42, line_height, max, 2)
  494.     end
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # ● 绘制 HP
  498.   #--------------------------------------------------------------------------
  499.   def draw_actor_hp(actor, x, y, width = 124)
  500.     draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  501.     change_color(system_color)
  502.     draw_text(x, y, 30, line_height, Vocab::hp_a)
  503.     draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
  504.       hp_color(actor), normal_color)
  505.   end
  506.   #--------------------------------------------------------------------------
  507.   # ● 绘制 MP
  508.   #--------------------------------------------------------------------------
  509.   def draw_actor_mp(actor, x, y, width = 124)
  510.     draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  511.     change_color(system_color)
  512.     draw_text(x, y, 30, line_height, Vocab::mp_a)
  513.     draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
  514.       mp_color(actor), normal_color)
  515.   end
  516.   #--------------------------------------------------------------------------
  517.   # ● 绘制 TP
  518.   #--------------------------------------------------------------------------
  519.   def draw_actor_tp(actor, x, y, width = 124)
  520.     draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
  521.     change_color(system_color)
  522.     draw_text(x, y, 30, line_height, Vocab::tp_a)
  523.     change_color(tp_color(actor))
  524.     draw_text(x + width - 42, y, 42, line_height, actor.tp.to_i, 2)
  525.   end
  526.   #--------------------------------------------------------------------------
  527.   # ● 绘制简单的状态
  528.   #--------------------------------------------------------------------------
  529.   def draw_actor_simple_status(actor, x, y)
  530.     draw_actor_name(actor, x, y)
  531.     draw_actor_level(actor, x, y + line_height * 1)
  532.     draw_actor_icons(actor, x, y + line_height * 2)
  533.     draw_actor_class(actor, x + 120, y)
  534.     draw_actor_hp(actor, x + 120, y + line_height * 1)
  535.     draw_actor_mp(actor, x + 120, y + line_height * 2)
  536.   end
  537.   #--------------------------------------------------------------------------
  538.   # ● 绘制能力值
  539.   #--------------------------------------------------------------------------
  540.   def draw_actor_param(actor, x, y, param_id)
  541.     change_color(system_color)
  542.     draw_text(x, y, 120, line_height, Vocab::param(param_id))
  543.     change_color(normal_color)
  544.     draw_text(x + 120, y, 36, line_height, actor.param(param_id), 2)
  545.   end
  546.   #--------------------------------------------------------------------------
  547.   # ● 绘制物品名称
  548.   #     enabled : 有效的标志。false 的时候使用半透明效果绘制
  549.   #--------------------------------------------------------------------------
  550.   def draw_item_name(item, x, y, enabled = true, width = 172)
  551.     return unless item
  552.     draw_icon(item.icon_index, x, y, enabled)
  553.     change_color(normal_color, enabled)
  554.     draw_text(x + 24, y, width, line_height, item.name)
  555.   end
  556.   #--------------------------------------------------------------------------
  557.   # ● 绘制货币数值(持有金钱之类的)
  558.   #--------------------------------------------------------------------------
  559.   def draw_currency_value(value, unit, x, y, width)
  560.     cx = text_size(unit).width
  561.     change_color(normal_color)
  562.     draw_text(x, y, width - cx - 2, line_height, value, 2)
  563.     change_color(system_color)
  564.     draw_text(x, y, width, line_height, unit, 2)
  565.   end
  566.   #--------------------------------------------------------------------------
  567.   # ● 获取能力值变化的绘制色
  568.   #--------------------------------------------------------------------------
  569.   def param_change_color(change)
  570.     return power_up_color   if change > 0
  571.     return power_down_color if change < 0
  572.     return normal_color
  573.   end
  574. end


第一次弄这个,求帮助w~

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21631
在线时间
9414 小时
注册时间
2012-6-19
帖子
7118

开拓者短篇九导演组冠军

2
发表于 2015-6-8 17:24:20 | 只看该作者
新人你好,你不附上你改过的地方的话谁知道你改的代码哪里有错……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
795
在线时间
4 小时
注册时间
2015-6-7
帖子
2
3
 楼主| 发表于 2015-6-8 17:57:49 | 只看该作者
喵呜喵5 发表于 2015-6-8 17:24
新人你好,你不附上你改过的地方的话谁知道你改的代码哪里有错……

抱歉  现在补上

改了个横板菜单、透明度
  1. class Window_MenuCommand < Window_HorzCommand
  2.   #--------------------------------------------------------------------------
  3.   # ● 初始化指令选择位置(类方法)
  4.   #--------------------------------------------------------------------------
  5.   def self.init_command_position
  6.     @@last_command_symbol = nil
  7.   end
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化对象
  10.   #--------------------------------------------------------------------------
  11.   def initialize
  12.     super(0, 0)
  13.     self.opacity = 30
  14.     select_last
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 获取窗口的宽度
  18.   #--------------------------------------------------------------------------
  19.   def window_width
  20.     return 544#160
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 获取窗口的高度
  24.   #--------------------------------------------------------------------------
  25.   def window_height
  26.     return 48
  27.   end
复制代码
菜单里加了个行走图
  1. #--------------------------------------------------------------------------
  2.   # ● 初始化对象
  3.   #--------------------------------------------------------------------------
  4.   def initialize(x, y)
  5.     super(0, 48, window_width, window_height)
  6.   end
  7.   #--------------------------------------------------------------------------
  8.   # ● 获取窗口的宽度
  9.   #--------------------------------------------------------------------------
  10.   def window_width
  11.     Graphics.width
  12.   end
  13.   #--------------------------------------------------------------------------
  14.   # ● 获取窗口的高度
  15.   #--------------------------------------------------------------------------
  16.   def window_height
  17.     Graphics.height - 96
  18.   end
复制代码
#--------------------------------------------------------------------------
  # ● 绘制项目
  #--------------------------------------------------------------------------
def draw_item(index)
    actor = $game_party.members[index]
    enabled = $game_party.battle_members.include?(actor)
    rect = item_rect(index)
    draw_item_background(index)
  1. def draw_item(index)
  2.     draw_actor_face(actor, rect.x + 20, rect.y + 1, enabled)
  3.     draw_actor_name(actor, rect.x + 0, rect.y+110)
  4.     draw_actor_nickname(actor, rect.x + 0, rect.y+140)
  5.     draw_actor_level(actor, rect.x + 0, rect.y+170)
  6.     draw_actor_hp(actor, rect.x + 0, rect.y+200)
  7.     draw_actor_mp(actor, rect.x + 0, rect.y+230)
  8.     draw_actor_graphic(actor, rect.x + 100, rect.y+180)
  9.     draw_actor_class(actor, rect.x + 75, rect.y+110)
  10.   end
复制代码
计时器正数
  1. #--------------------------------------------------------------------------
  2.   # ● オブジェクト初期化
  3.   #--------------------------------------------------------------------------
  4.   def initialize
  5.     @count = 0
  6.     @working = true
  7.   end
  8.   #--------------------------------------------------------------------------
  9.   # ● フレーム更新
  10.   #--------------------------------------------------------------------------
  11.   def update
  12.     if @working #&& @count = 0
  13.       @count += 1
  14.     end
  15.   end
复制代码
还有字体
  1. #==============================================================================
  2. # ■ Main
  3. #------------------------------------------------------------------------------
  4. #  モジュールとクラスの定義が終わった後に実行される処理です。
  5. #==============================================================================

  6. Font.default_name=["karvwood bold","Karvwood"]
复制代码
就这些

点评

出错的地方似乎并不在这?初步判断:是否改过Window_BattleStatus的窗口宽度?  发表于 2015-6-8 21:13
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-16 04:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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