查看: 1974|回复: 3

[已经过期] 光标矩形才显示第二种行走图,其他显示第一种行走图

[复制链接]
梦石
0
星屑
445
在线时间
377 小时
注册时间
2012-11-5
回帖
196
发表于 2016-3-14 17:46:43 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 789456qwe 于 2016-3-16 15:00 编辑

光标矩形才显示第二种行走图,其他显示第一种行走图
光际矩形移动到第一个角色时,显示第二种行走图。其他角色显示第一种行走图

光际矩形移动到第二个角色时,显示第二种行走图。其他角色显示第一种行走图

光际矩形移动到第三个角色时,显示第三种行走图。其他角色显示第一种行走图

光际矩形移动到第四个角色时,显示第三种行走图。其他角色显示第一种行走图

第一种行走图

第二种行走图
yy.JPG
yy2.JPG
梦石
0
星屑
1788
在线时间
1313 小时
注册时间
2012-8-4
回帖
724
发表于 2016-3-15 17:25:17 | 显示全部楼层
- - 360截图20160315172014617.jpg
360截图20160315172040273.jpg

Project65.zip (211.4 KB, 下载次数: 52)
回复

使用道具 举报

梦石
0
星屑
445
在线时间
377 小时
注册时间
2012-11-5
回帖
196
 楼主| 发表于 2016-3-16 11:46:28 | 显示全部楼层
夜狠简单 发表于 2016-3-15 17:25

我没有说清楚,光际矩形移动到第二个角色时,显示第二种行走图。第一个角色与其他角色显示第一种行走图。我错了。

点评

每个光标位置显示自己对应的图片吗?  发表于 2016-3-17 20:54
回复

使用道具 举报

梦石
0
星屑
1788
在线时间
1313 小时
注册时间
2012-8-4
回帖
724
发表于 2016-3-16 15:40:12 | 显示全部楼层
自己改下附件里面的图片名字 没有2号角色的图片

Window_MenuStatus####==============================================================================
# ■ Window_MenuStatus
#------------------------------------------------------------------------------
#  显示菜单画面和同伴状态的窗口。
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● 初始化目标
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 480, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 116
      actor = $game_party.actors
      draw_actor_graphic(actor, x - 40, y + 80)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x, y + 32)
      draw_actor_state(actor, x + 90, y + 32)
      draw_actor_exp(actor, x, y + 64)
      draw_actor_hp(actor, x + 236, y + 32)
      draw_actor_sp(actor, x + 236, y + 64)
    end
  end
  
  #--------------------------------------------------------------------------
  # ● 图形的描绘
  #     actor : 角色
  #     x     : 描画目标 X 坐标
  #     y     : 描画目标 Y 坐标
  #--------------------------------------------------------------------------
  def draw_actor_graphic1(actor, x, y)
    #actor.character_hue这个可以写个哈希表或数组来保存数据,下面用默认
    bitmap = RPG::Cache.character("actor_xz#{actor.id}", actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
  end
  def refresh1
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 116
      actor = $game_party.actors
      if FileTest.exist?("Graphics/Characters/actor_xz#{actor.id}.png") ==true and i==1  #如果是固定2号角色就判断  ==true and actor.id==2
      draw_actor_graphic1(actor, x - 40, y + 80)
    else
      draw_actor_graphic(actor, x - 40, y + 80)
      end
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x, y + 32)
      draw_actor_state(actor, x + 90, y + 32)
      draw_actor_exp(actor, x, y + 64)
      draw_actor_hp(actor, x + 236, y + 32)
      draw_actor_sp(actor, x + 236, y + 64)
    end
  end



  #--------------------------------------------------------------------------
  # ● 刷新光标矩形
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      refresh
      self.cursor_rect.empty
    else
       self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
      refresh1 if @index == 1
     
    end
  end
end
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部