| 
 
| 赞 | 11 |  
| VIP | 302 |  
| 好人卡 | 162 |  
| 积分 | 63 |  
| 经验 | 108302 |  
| 最后登录 | 2025-10-28 |  
| 在线时间 | 6605 小时 |  
 Lv4.逐梦者 醉啸 长风万里 
	梦石0 星屑6322 在线时间6605 小时注册时间2007-12-16帖子4504 
 | 
| 
本帖最后由 仲秋启明 于 2011-7-14 12:56 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 一个的话太简短了,弄个三合一
 一、显示图标Window_Command
 
 几天前写的,写完后发现有一个日站游戏的方法和这个一样。别说我是抄的!!!
 二、不同的人有不同的战斗选项复制代码#==============================================================================
# ■ 显示图标的Window_Command BY 仲秋启明
#------------------------------------------------------------------------------
#  使用方法:在选项前加上"#{X}"即可
#            比如:s1 = "#{12}" + Vocab::new_game
#==============================================================================
class Window_Command < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 绘制项目
  #     index   : 项目位置
  #     enabled : 有效标志,false时项目半透明化
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
    rect = item_rect(index)
    rect.x += 4
    rect.width -= 8
    self.contents.clear_rect(rect)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    if /^(\d+)/ =~ @commands[index]
      draw_icon($1.to_i, rect.x, rect.y, enabled)
      rect.x += 26
      rect.width -= 26
      self.contents.draw_text(rect, $')
    else
      self.contents.draw_text(rect, commands[index])
    end
  end
end
 KCG的那个太麻烦了,精简
 三、战斗精简头像显示复制代码#==============================================================================
# ■ 不同的人有不同的战斗选项 BY 仲秋启明
#------------------------------------------------------------------------------
#  KCG的那个太麻烦了于是就有了这个简单的方法
#------------------------------------------------------------------------------
#  使用方法:根据角色ID设定即可
#==============================================================================
class Window_ActorCommand < Window_Command
  #--------------------------------------------------------------------------
  # ● 设置
  #     actor : 角色
  #--------------------------------------------------------------------------
  def setup(actor)
    case actor.id
    when 1 #原版
     s1 = Vocab::attack
     s2 = Vocab::skill
     s3 = Vocab::guard
     s4 = Vocab::item
    when 2 #改
     s1 =  "轰他"
     s2 =  "飞腿"
     s3 =  "格挡"
     s4 = "吃饭"
    else #原版
     s1 = Vocab::attack
     s2 = Vocab::skill
     s3 = Vocab::guard
     s4 = Vocab::item
    end
    if actor.class.skill_name_valid     # 是否指定职业技能文字
      s2 = actor.class.skill_name       # 替换「技能」命令文字
    end
    @commands = [s1, s2, s3, s4]
    @item_max = 4
    refresh
    self.index = 0
  end
end
 《黑狮子纹章》的方法需要再准备一个素材,为精简游戏体积
 综合截图:没有好好排版复制代码#==============================================================================
# ■ 战斗精简头像显示 BY 仲秋启明
#------------------------------------------------------------------------------
#  这个比《黑狮子纹章》的方法简单且不同准备多余素材
#==============================================================================
class Window_Base < Window
  #--------------------------------------------------------------------------
  # ● 绘制战斗状态头像
  #     face_name  : 头像文件名
  #     face_index : 头像号码
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     size       : 显示大小
  #--------------------------------------------------------------------------
  def draw_status_face(face_name, face_index, x, y, size = 96)
    bitmap = Cache.face(face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = face_index % 4 * 96 + (96 - size) / 2
    rect.y = face_index / 4 * 96 + (96 - size) / 2 + 30
    rect.width = 96
    rect.height = 32
    self.contents.blt(x, y, bitmap, rect)
    bitmap.dispose
  end
  #--------------------------------------------------------------------------
  # ● 绘制战斗状态头像
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #     size  : 绘制大小
  #--------------------------------------------------------------------------
  def draw_statu_face(actor, x, y)
    draw_status_face(actor.face_name, actor.face_index, x, y)
  end
end
class Window_BattleStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 描绘项目
  #     index : 项目索引
  #--------------------------------------------------------------------------
  alias draw_face_item draw_item
  def draw_item(index)
    draw_face_item(index)
    rect = item_rect(index)
    actor = $game_party.members[index]
    draw_statu_face(actor, 67, rect.y)  #坐标自己改
  end
end
     
 
 综合范例:
  三合一.rar
(240.56 KB, 下载次数: 401) | 
 评分
查看全部评分
 |