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

Project1

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

[讨论] 一个脚本新手写的在菜单中显示人物头像的脚本

[复制链接]

Lv3.寻梦者

○赛

梦石
0
星屑
1249
在线时间
1276 小时
注册时间
2013-1-22
帖子
2246

贵宾

跳转到指定楼层
1
发表于 2013-8-10 20:36:42 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
大家好,我是小周。我是一个接触RM一年左右的RMer,这几天准备学习一下脚本,看了许多教程,准备自己写一个实用的小功能。首先想到的是在菜单中显示人物头像,效果如图:

脚本我在下面发,主要是自己知道这些脚本写的不是很好,有些可以简便的地方没有简便,用了死算的方法,所以想请各位大大指导以下。
  1. #==============================================================================
  2. # ■ Window_Base_Menu
  3. #------------------------------------------------------------------------------
  4. #  游戏中菜单窗口的超级类。
  5. #==============================================================================

  6. class Window_Base_Menu < Window
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     x      : 窗口的 X 坐标
  10.   #     y      : 窗口的 Y 坐标
  11.   #     width  : 窗口的宽
  12.   #     height : 窗口的宽
  13.   #--------------------------------------------------------------------------
  14.   def initialize(x, y, width, height)
  15.     super()
  16.     @windowskin_name = $game_system.windowskin_name
  17.     self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  18.     self.x = x
  19.     self.y = y
  20.     self.width = width
  21.     self.height = height
  22.     self.z = 100
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ● 释放
  26.   #--------------------------------------------------------------------------
  27.   def dispose
  28.     # 如果窗口的内容已经被设置就被释放
  29.     if self.contents != nil
  30.       self.contents.dispose
  31.     end
  32.     super
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # ● 获取文字色
  36.   #     n : 文字色编号 (0~7)
  37.   #--------------------------------------------------------------------------
  38.   def text_color(n)
  39.     case n
  40.     when 0
  41.       return Color.new(255, 255, 255, 255)
  42.     when 1
  43.       return Color.new(128, 128, 255, 255)
  44.     when 2
  45.       return Color.new(255, 128, 128, 255)
  46.     when 3
  47.       return Color.new(128, 255, 128, 255)
  48.     when 4
  49.       return Color.new(128, 255, 255, 255)
  50.     when 5
  51.       return Color.new(255, 128, 255, 255)
  52.     when 6
  53.       return Color.new(255, 255, 128, 255)
  54.     when 7
  55.       return Color.new(192, 192, 192, 255)
  56.     else
  57.       normal_color
  58.     end
  59.   end
  60.   #--------------------------------------------------------------------------
  61.   # ● 获取普通文字色
  62.   #--------------------------------------------------------------------------
  63.   def normal_color
  64.     return Color.new(255, 255, 255, 255)
  65.   end
  66.   #--------------------------------------------------------------------------
  67.   # ● 获取无效文字色
  68.   #--------------------------------------------------------------------------
  69.   def disabled_color
  70.     return Color.new(255, 255, 255, 128)
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # ● 获取系统文字色
  74.   #--------------------------------------------------------------------------
  75.   def system_color
  76.     return Color.new(192, 224, 255, 255)
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● 获取危机文字色
  80.   #--------------------------------------------------------------------------
  81.   def crisis_color
  82.     return Color.new(255, 255, 64, 255)
  83.   end
  84.   #--------------------------------------------------------------------------
  85.   # ● 获取战斗不能文字色
  86.   #--------------------------------------------------------------------------
  87.   def knockout_color
  88.     return Color.new(255, 64, 0)
  89.   end
  90.   #--------------------------------------------------------------------------
  91.   # ● 刷新画面
  92.   #--------------------------------------------------------------------------
  93.   def update
  94.     super
  95.     # 如果窗口的外观被变更了、再设置
  96.     if $game_system.windowskin_name != @windowskin_name
  97.       @windowskin_name = $game_system.windowskin_name
  98.       self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  99.     end
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ● 图形的描绘
  103.   #     actor : 角色
  104.   #     x     : 描画目标 X 坐标
  105.   #     y     : 描画目标 Y 坐标
  106.   #--------------------------------------------------------------------------
  107.   def draw_actor_graphic(actor, x, y)
  108.    #bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
  109.    #取消原有的生成角色行走图,改为读取行走图文件夹中角色名字带_Menu的文件
  110.     bitmap = RPG::Cache.character($game_party.actors[0].name + "_Menu", actor.character_hue)
  111. #    cw = bitmap.width / 4
  112. #    ch = bitmap.height / 4
  113.     cw = bitmap.width
  114.     ch = bitmap.height
  115.     src_rect = Rect.new(0, 0, cw, ch)
  116. #    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  117.      for o in 0...$game_party.actors.size
  118.        case o
  119.        when 0
  120.       self.contents.blt(0, 0, bitmap, src_rect)
  121.        when 1
  122.     bitmap2 = RPG::Cache.character($game_party.actors[1].name + "_Menu", $game_party.actors[1].character_hue)
  123.          self.contents.blt(0, 0 + 116, bitmap2, src_rect)
  124.        when 2
  125.     bitmap3 = RPG::Cache.character($game_party.actors[2].name + "_Menu", $game_party.actors[2].character_hue)
  126.          self.contents.blt(0, 0 + 116 + 116, bitmap3, src_rect)
  127.        when 3
  128.     bitmap4 = RPG::Cache.character($game_party.actors[3].name + "_Menu", $game_party.actors[3].character_hue)
  129.          self.contents.blt(0, 0 + 116 + 116 + 116, bitmap4, src_rect)
  130.       end
  131.    end
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # ● 名称的描绘
  135.   #     actor : 角色
  136.   #     x     : 描画目标 X 坐标
  137.   #     y     : 描画目标 Y 坐标
  138.   #--------------------------------------------------------------------------
  139.   def draw_actor_name(actor, x, y)
  140.     self.contents.font.color = normal_color
  141. #   self.contents.draw_text(x, y, 120, 32, actor.name)
  142.     self.contents.draw_text(x + 60, y, 120, 32, actor.name)
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # ● 职业的描绘
  146.   #     actor : 角色
  147.   #     x     : 描画目标 X 坐标
  148.   #     y     : 描画目标 Y 坐标
  149.   #--------------------------------------------------------------------------
  150.   def draw_actor_class(actor, x, y)
  151.     self.contents.font.color = normal_color
  152. #    self.contents.draw_text(x, y, 236, 32, actor.class_name)
  153.     self.contents.draw_text(x + 60, y, 236, 32, actor.class_name)
  154.   end
  155.   #--------------------------------------------------------------------------
  156.   # ● 等级的描绘
  157.   #     actor : 角色
  158.   #     x     : 描画目标 X 坐标
  159.   #     y     : 描画目标 Y 坐标
  160.   #--------------------------------------------------------------------------
  161.   def draw_actor_level(actor, x, y)
  162.     self.contents.font.color = system_color
  163. #    self.contents.draw_text(x, y, 32, 32, "Lv")
  164.     self.contents.draw_text(x + 60, y, 32, 32, "Lv")
  165.     self.contents.font.color = normal_color
  166. #    self.contents.draw_text(x + 32, y, 24, 32, actor.level.to_s, 2)
  167. #    self.contents.draw_text(x + 32 + 60, y, 24, 32, actor.level.to_s, 2)
  168.     self.contents.draw_text(x + 32 + 60, y, 24, 32, actor.level.to_s, 2)
  169.   end
  170.   #--------------------------------------------------------------------------
  171.   # ● 生成描绘用的状态字符串
  172.   #     actor       : 角色
  173.   #     width       : 描画目标的宽度
  174.   #     need_normal : [正常] 是否为必须 (true / false)
  175.   #--------------------------------------------------------------------------
  176.   def make_battler_state_text(battler, width, need_normal)
  177.     # 获取括号的宽
  178.     brackets_width = self.contents.text_size("[]").width
  179.     # 生成状态名字符串
  180.     text = ""
  181.     for i in battler.states
  182.       if $data_states[i].rating >= 1
  183.         if text == ""
  184.           text = $data_states[i].name
  185.         else
  186.           new_text = text + "/" + $data_states[i].name
  187.           text_width = self.contents.text_size(new_text).width
  188.           if text_width > width - brackets_width
  189.             break
  190.           end
  191.           text = new_text
  192.         end
  193.       end
  194.     end
  195.     # 状态名空的字符串是 "[正常]" 的情况下
  196.     if text == ""
  197.       if need_normal
  198.         text = "[正常]"
  199.       end
  200.     else
  201.       # 加上括号
  202.       text = "[" + text + "]"
  203.     end
  204.     # 返回完成后的文字类
  205.     return text
  206.   end
  207.   #--------------------------------------------------------------------------
  208.   # ● 描绘状态
  209.   #     actor : 角色
  210.   #     x     : 描画目标 X 坐标
  211.   #     y     : 描画目标 Y 坐标
  212.   #     width : 描画目标的宽
  213.   #--------------------------------------------------------------------------
  214.   def draw_actor_state(actor, x, y, width = 120)
  215.     text = make_battler_state_text(actor, width, true)
  216.     self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
  217. #    self.contents.draw_text(x, y, width, 32, text)
  218.     self.contents.draw_text(x + 60, y, width, 32, text)
  219.   end
  220.   #--------------------------------------------------------------------------
  221.   # ● 描绘 EXP
  222.   #     actor : 角色
  223.   #     x     : 描画目标 X 坐标
  224.   #     y     : 描画目标 Y 坐标
  225.   #--------------------------------------------------------------------------
  226.   def draw_actor_exp(actor, x, y)
  227.     self.contents.font.color = system_color
  228. #    self.contents.draw_text(x, y, 24, 32, "E")
  229.     self.contents.draw_text(x + 60, y, 24, 32, "E")
  230.     self.contents.font.color = normal_color
  231. #    self.contents.draw_text(x + 24, y, 84, 32, actor.exp_s, 2)
  232. #    self.contents.draw_text(x + 108, y, 12, 32, "/", 1)
  233. #    self.contents.draw_text(x + 120, y, 84, 32, actor.next_exp_s)
  234.     self.contents.draw_text(x + 24 + 60, y, 84, 32, actor.exp_s, 2)
  235.     self.contents.draw_text(x + 108 + 60, y, 12, 32, "/", 1)
  236.     self.contents.draw_text(x + 120 + 60, y, 84, 32, actor.next_exp_s)
  237.   end
  238.   #--------------------------------------------------------------------------
  239.   # ● 描绘 HP
  240.   #     actor : 角色
  241.   #     x     : 描画目标 X 坐标
  242.   #     y     : 描画目标 Y 坐标
  243.   #     width : 描画目标的宽
  244.   #--------------------------------------------------------------------------
  245.   def draw_actor_hp(actor, x, y, width = 144)
  246.     # 描绘字符串 "HP"
  247.     self.contents.font.color = system_color
  248.     self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
  249.     # 计算描绘 MaxHP 所需的空间
  250.     if width - 32 >= 108
  251.       hp_x = x + width - 108
  252.       flag = true
  253.     elsif width - 32 >= 48
  254.       hp_x = x + width - 48
  255.       flag = false
  256.     end
  257.     # 描绘 HP
  258.     self.contents.font.color = actor.hp == 0 ? knockout_color :
  259.       actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  260.     self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
  261.     # 描绘 MaxHP
  262.     if flag
  263.       self.contents.font.color = normal_color
  264.       self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
  265.       self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
  266.     end
  267.   end
  268.   #--------------------------------------------------------------------------
  269.   # ● 描绘 SP
  270.   #     actor : 角色
  271.   #     x     : 描画目标 X 坐标
  272.   #     y     : 描画目标 Y 坐标
  273.   #     width : 描画目标的宽
  274.   #--------------------------------------------------------------------------
  275.   def draw_actor_sp(actor, x, y, width = 144)
  276.     # 描绘字符串 "SP"
  277.     self.contents.font.color = system_color
  278.     self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
  279.     # 计算描绘 MaxSP 所需的空间
  280.     if width - 32 >= 108
  281.       sp_x = x + width - 108
  282.       flag = true
  283.     elsif width - 32 >= 48
  284.       sp_x = x + width - 48
  285.       flag = false
  286.     end
  287.     # 描绘 SP
  288.     self.contents.font.color = actor.sp == 0 ? knockout_color :
  289.       actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  290.     self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
  291.     # 描绘 MaxSP
  292.     if flag
  293.       self.contents.font.color = normal_color
  294.       self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
  295.       self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
  296.     end
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ● 描绘能力值
  300.   #     actor : 角色
  301.   #     x     : 描画目标 X 坐标
  302.   #     y     : 描画目标 Y 坐标
  303.   #     type  : 能力值种类 (0~6)
  304.   #--------------------------------------------------------------------------
  305.   def draw_actor_parameter(actor, x, y, type)
  306.     case type
  307.     when 0
  308.       parameter_name = $data_system.words.atk
  309.       parameter_value = actor.atk
  310.     when 1
  311.       parameter_name = $data_system.words.pdef
  312.       parameter_value = actor.pdef
  313.     when 2
  314.       parameter_name = $data_system.words.mdef
  315.       parameter_value = actor.mdef
  316.     when 3
  317.       parameter_name = $data_system.words.str
  318.       parameter_value = actor.str
  319.     when 4
  320.       parameter_name = $data_system.words.dex
  321.       parameter_value = actor.dex
  322.     when 5
  323.       parameter_name = $data_system.words.agi
  324.       parameter_value = actor.agi
  325.     when 6
  326.       parameter_name = $data_system.words.int
  327.       parameter_value = actor.int
  328.     end
  329.     self.contents.font.color = system_color
  330.     self.contents.draw_text(x, y, 120, 32, parameter_name)
  331.     self.contents.font.color = normal_color
  332.     self.contents.draw_text(x + 120, y, 36, 32, parameter_value.to_s, 2)
  333.   end
  334.   #--------------------------------------------------------------------------
  335.   # ● 描绘物品名
  336.   #     item : 物品
  337.   #     x    : 描画目标 X 坐标
  338.   #     y    : 描画目标 Y 坐标
  339.   #--------------------------------------------------------------------------
  340.   def draw_item_name(item, x, y)
  341.     if item == nil
  342.       return
  343.     end
  344.     bitmap = RPG::Cache.icon(item.icon_name)
  345.     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
  346.     self.contents.font.color = normal_color
  347.     self.contents.draw_text(x + 28, y, 212, 32, item.name)
  348.   end
  349. end
复制代码
这是我修改过的Window_Base。
  1. #==============================================================================
  2. # ■ Window_Menu_Selectable
  3. #------------------------------------------------------------------------------
  4. #  拥有光标的移动以及滚动功能的菜单窗口类。
  5. #==============================================================================

  6. class Window_Menu_Selectable < Window_Base_Menu
  7.   #--------------------------------------------------------------------------
  8.   # ● 定义实例变量
  9.   #--------------------------------------------------------------------------
  10.   attr_reader   :index                    # 光标位置
  11.   attr_reader   :help_window              # 帮助窗口
  12.   #--------------------------------------------------------------------------
  13.   # ● 初始画对像
  14.   #     x      : 窗口的 X 坐标
  15.   #     y      : 窗口的 Y 坐标
  16.   #     width  : 窗口的宽
  17.   #     height : 窗口的高
  18.   #--------------------------------------------------------------------------
  19.   def initialize(x, y, width, height)
  20.     super(x, y, width, height)
  21.     @item_max = 1
  22.     @column_max = 1
  23.     [url=home.php?mod=space&uid=370741]@Index[/url] = -1
  24.   end
  25.   #--------------------------------------------------------------------------
  26.   # ● 设置光标的位置
  27.   #     index : 新的光标位置
  28.   #--------------------------------------------------------------------------
  29.   def index=(index)
  30.     @index = index
  31.     # 刷新帮助文本 (update_help 定义了继承目标)
  32.     if self.active and @help_window != nil
  33.       update_help
  34.     end
  35.     # 刷新光标矩形
  36.     update_cursor_rect
  37.   end
  38.   #--------------------------------------------------------------------------
  39.   # ● 获取行数
  40.   #--------------------------------------------------------------------------
  41.   def row_max
  42.     # 由项目数和列数计算出行数
  43.     return (@item_max + @column_max - 1) / @column_max
  44.   end
  45.   #--------------------------------------------------------------------------
  46.   # ● 获取开头行
  47.   #--------------------------------------------------------------------------
  48.   def top_row
  49.     # 将窗口内容的传送源 Y 坐标、1 行的高 32 等分
  50.     return self.oy / 32
  51.   end
  52.   #--------------------------------------------------------------------------
  53.   # ● 设置开头行
  54.   #     row : 显示开头的行
  55.   #--------------------------------------------------------------------------
  56.   def top_row=(row)
  57.     # row 未满 0 的场合更正为 0
  58.     if row < 0
  59.       row = 0
  60.     end
  61.     # row 超过 row_max - 1 的情况下更正为 row_max - 1
  62.     if row > row_max - 1
  63.       row = row_max - 1
  64.     end
  65.     # row 1 行高的 32 倍、窗口内容的传送源 Y 坐标
  66.     self.oy = row * 32
  67.   end
  68.   #--------------------------------------------------------------------------
  69.   # ● 获取 1 页可以显示的行数
  70.   #--------------------------------------------------------------------------
  71.   def page_row_max
  72.     # 窗口的高度,设置画面的高度减去 32 ,除以 1 行的高度 32
  73.     return (self.height - 32) / 32
  74.   end
  75.   #--------------------------------------------------------------------------
  76.   # ● 获取 1 页可以显示的项目数
  77.   #--------------------------------------------------------------------------
  78.   def page_item_max
  79.     # 将行数 page_row_max 乘上列数 @column_max
  80.     return page_row_max * @column_max
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # ● 帮助窗口的设置
  84.   #     help_window : 新的帮助窗口
  85.   #--------------------------------------------------------------------------
  86.   def help_window=(help_window)
  87.     @help_window = help_window
  88.     # 刷新帮助文本 (update_help 定义了继承目标)
  89.     if self.active and @help_window != nil
  90.       update_help
  91.     end
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ● 更新光标矩形
  95.   #--------------------------------------------------------------------------
  96.   def update_cursor_rect
  97.     # 光标位置不满 0 的情况下
  98.     if @index < 0
  99.       self.cursor_rect.empty
  100.       return
  101.     end
  102.     # 获取当前的行
  103.     row = @index / @column_max
  104.     # 当前行被显示开头行前面的情况下
  105.     if row < self.top_row
  106.       # 从当前行向开头行滚动
  107.       self.top_row = row
  108.     end
  109.     # 当前行被显示末尾行之后的情况下
  110.     if row > self.top_row + (self.page_row_max - 1)
  111.       # 从当前行向末尾滚动
  112.       self.top_row = row - (self.page_row_max - 1)
  113.     end
  114.     # 计算光标的宽度
  115.     cursor_width = self.width / @column_max - 32
  116.     # 计算光标坐标
  117.     x = @index % @column_max * (cursor_width + 32)
  118.     y = @index / @column_max * 32 - self.oy
  119.     # 更新光标矩形
  120.     self.cursor_rect.set(x, y, cursor_width, 32)
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● 刷新画面
  124.   #--------------------------------------------------------------------------
  125.   def update
  126.     super
  127.     # 可以移动光标的情况下
  128.     if self.active and @item_max > 0 and @index >= 0
  129.       # 方向键下被按下的情况下
  130.       if Input.repeat?(Input::DOWN)
  131.         # 列数不是 1 并且不与方向键下的按下状态重复的情况、
  132.         # 或光标位置在(项目数-列数)之前的情况下
  133.         if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
  134.            @index < @item_max - @column_max
  135.           # 光标向下移动
  136.           $game_system.se_play($data_system.cursor_se)
  137.           @index = (@index + @column_max) % @item_max
  138.         end
  139.       end
  140.       # 方向键上被按下的情况下
  141.       if Input.repeat?(Input::UP)
  142.         # 列数不是 1 并且不与方向键下的按下状态重复的情况、
  143.         # 或光标位置在列之后的情况下
  144.         if (@column_max == 1 and Input.trigger?(Input::UP)) or
  145.            @index >= @column_max
  146.           # 光标向上移动
  147.           $game_system.se_play($data_system.cursor_se)
  148.           @index = (@index - @column_max + @item_max) % @item_max
  149.         end
  150.       end
  151.       # 方向键右被按下的情况下
  152.       if Input.repeat?(Input::RIGHT)
  153.         # 列数为 2 以上并且、光标位置在(项目数 - 1)之前的情况下
  154.         if @column_max >= 2 and @index < @item_max - 1
  155.           # 光标向右移动
  156.           $game_system.se_play($data_system.cursor_se)
  157.           @index += 1
  158.         end
  159.       end
  160.       # 方向键左被按下的情况下
  161.       if Input.repeat?(Input::LEFT)
  162.         # 列数为 2 以上并且、光标位置在 0 之后的情况下
  163.         if @column_max >= 2 and @index > 0
  164.           # 光标向左移动
  165.           $game_system.se_play($data_system.cursor_se)
  166.           @index -= 1
  167.         end
  168.       end
  169.       # R 键被按下的情况下
  170.       if Input.repeat?(Input::R)
  171.         # 显示的最后行在数据中最后行上方的情况下
  172.         if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
  173.           # 光标向后移动一页
  174.           $game_system.se_play($data_system.cursor_se)
  175.           @index = [@index + self.page_item_max, @item_max - 1].min
  176.           self.top_row += self.page_row_max
  177.         end
  178.       end
  179.       # L 键被按下的情况下
  180.       if Input.repeat?(Input::L)
  181.         # 显示的开头行在位置 0 之后的情况下
  182.         if self.top_row > 0
  183.           # 光标向前移动一页
  184.           $game_system.se_play($data_system.cursor_se)
  185.           @index = [@index - self.page_item_max, 0].max
  186.           self.top_row -= self.page_row_max
  187.         end
  188.       end
  189.     end
  190.     # 刷新帮助文本 (update_help 定义了继承目标)
  191.     if self.active and @help_window != nil
  192.       update_help
  193.     end
  194.     # 刷新光标矩形
  195.     update_cursor_rect
  196.   end
  197. end
复制代码
这是我修改过的Window_Selectable。
  1. #==============================================================================
  2. # ■ Window_MenuStatus
  3. #------------------------------------------------------------------------------
  4. #  显示菜单画面和同伴状态的窗口。
  5. #==============================================================================

  6. class Window_MenuStatus < Window_Menu_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化目标
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 0, 480, 480)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     refresh
  14.     self.active = false
  15.     self.index = -1
  16.   end
  17.   #--------------------------------------------------------------------------
  18.   # ● 刷新
  19.   #--------------------------------------------------------------------------
  20.   def refresh
  21.     self.contents.clear
  22.     @item_max = $game_party.actors.size
  23.     for i in 0...$game_party.actors.size
  24.       x = 64
  25.       y = i * 116
  26.       actor = $game_party.actors[i]
  27.       draw_actor_graphic(actor, x - 40, y + 80)
  28.       draw_actor_name(actor, x, y)
  29.       draw_actor_class(actor, x + 144, y)
  30.       draw_actor_level(actor, x, y + 32)
  31.       draw_actor_state(actor, x + 90, y + 32)
  32.       draw_actor_exp(actor, x, y + 64)
  33.       draw_actor_hp(actor, x + 236, y + 32)
  34.       draw_actor_sp(actor, x + 236, y + 64)
  35.     end
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # ● 刷新光标矩形
  39.   #--------------------------------------------------------------------------
  40.   def update_cursor_rect
  41.     if @index < 0
  42.       self.cursor_rect.empty
  43.     else
  44.       self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
  45.     end
  46.   end
  47. end
复制代码
这是我修改过的Window_MenuStatus。
以上就是脚本,请各位看看,帮忙修改一下,这可也是我花了差不多一个小时修改的呢!

点评

额额  发表于 2013-8-11 12:42
↓正解  发表于 2013-8-11 12:37
扫戴斯乃  发表于 2013-8-11 08:26
(电脑就是给我们死算和糟蹋的  发表于 2013-8-10 21:06

Lv3.寻梦者

○赛

梦石
0
星屑
1249
在线时间
1276 小时
注册时间
2013-1-22
帖子
2246

贵宾

2
 楼主| 发表于 2013-8-11 14:15:06 | 只看该作者
没人看了吗?顶一下啊
回复 支持 反对

使用道具 举报

Lv3.寻梦者

○赛

梦石
0
星屑
1249
在线时间
1276 小时
注册时间
2013-1-22
帖子
2246

贵宾

3
 楼主| 发表于 2013-8-11 20:07:59 | 只看该作者
喂喂真没人看么
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
65
在线时间
148 小时
注册时间
2010-5-20
帖子
97
4
发表于 2013-9-11 09:15:30 | 只看该作者
那個... 跟原來的有什麼分別??
我呆看了兩分鐘耶..
回复 支持 反对

使用道具 举报

Lv3.寻梦者

○赛

梦石
0
星屑
1249
在线时间
1276 小时
注册时间
2013-1-22
帖子
2246

贵宾

5
 楼主| 发表于 2013-9-11 19:08:12 | 只看该作者
pahk2006 发表于 2013-9-11 09:15
那個... 跟原來的有什麼分別??
我呆看了兩分鐘耶..

原来的显示行走图
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-28 15:29

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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