Project1

标题: 请问人物状态坐标怎么修改? [打印本页]

作者: sun1007    时间: 2011-8-24 22:20
标题: 请问人物状态坐标怎么修改?
我想把下图的人物状态的图片显示改成显示我想要的图片,要修改哪些脚本??
具体怎么改?
dsu_plus_rewardpost_czw
作者: Wind2010    时间: 2011-8-24 22:22
Window_Status脚本的第23行
  1.     draw_actor_graphic(@actor, 40, 112)
复制代码
具体怎么改的话学过点脚本的都会的
作者: sun1007    时间: 2011-8-24 22:47
Wind2010 发表于 2011-8-24 22:22
Window_Status脚本的第23行具体怎么改的话学过点脚本的都会的

我就是不会怎么把图片换成其他的,比如XXXXX_h的图片。。。求解


sun1007于2011-8-24 22:52补充以下内容:
突然弄好了。。。
def draw_actor_face(actor,x,y)
bitmap = RPG::Cache.battler(actor.name + "_q" , actor.battler_hue)
self.contents.blt(x,y,bitmap,Rect.new(0,0,bitmap.width,bitmap.height ))
end


draw_actor_face(actor,x-40,y-0)


sun1007于2011-8-24 23:01补充以下内容:
。。。貌似还不对。。。求解
作者: 懒虫起床    时间: 2011-8-25 03:00
sun1007 发表于 2011-8-24 22:47
我就是不会怎么把图片换成其他的,比如XXXXX_h的图片。。。求解

这样应该对的啊,你把坐标改成16 , 16试试出来没有
作者: liuziyuan201019    时间: 2011-8-25 07:31
#==============================================================================
# ■ 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[i]
      testname = actor.id.to_s + "-TX"
      bitmap = Bitmap.new("Graphics/Pictures/#{testname}")
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
      self.contents.blt(0, y, bitmap, src_rect)
      draw_actor_name(actor, x + 5, y)
      draw_actor_level(actor, x + 5, y + 32)
      draw_actor_state(actor, x + 90, y + 32)
      draw_actor_exp(actor, x + 5, y + 64)
      draw_actor_hp(actor, x + 220, y + 32)
      draw_actor_sp(actor, x + 220, y + 64)
    end
  end
  #--------------------------------------------------------------------------
  # ● 刷新光标矩形
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
    end
  end
end



liuziyuan201019于2011-8-25 07:32补充以下内容:
图片名就是人物(角色)序号+TX。
这时访大话的,图片名自己调。
作者: sun1007    时间: 2011-8-25 20:11
liuziyuan201019 发表于 2011-8-25 07:31
#==============================================================================
# ■ Window_MenuStat ...

谢谢你。。。不过我想修改的是人物状态,不是选框栏,我是想改Window_Status
,能帮忙改一下么?
#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
#  显示状态画面、完全规格的状态窗口。
#==============================================================================

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 40, 112)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 96, 32)
    draw_actor_state(@actor, 96, 64)
    draw_actor_hp(@actor, 96, 112, 172)
    draw_actor_sp(@actor, 96, 144, 172)
    draw_actor_parameter(@actor, 96, 192, 0)
    draw_actor_parameter(@actor, 96, 224, 1)
    draw_actor_parameter(@actor, 96, 256, 2)
    draw_actor_parameter(@actor, 96, 304, 3)
    draw_actor_parameter(@actor, 96, 336, 4)
    draw_actor_parameter(@actor, 96, 368, 5)
    draw_actor_parameter(@actor, 96, 400, 6)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 48, 80, 32, "EXP")
    self.contents.draw_text(320, 80, 80, 32, "NEXT")
    self.contents.font.color = normal_color
    self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 160, 96, 32, "装备")
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
  end
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  end
end

作者: liuziyuan201019    时间: 2011-8-26 08:41
#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
#  显示状态画面、完全规格的状态窗口。
#==============================================================================

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    a = @actor.id.to_s + "-BS"
    bitmap=Bitmap.new("Graphics/Pictures/#{a}")
    src_rect = Rect.new(10, 5, bitmap.width, bitmap.height)
    self.contents.blt(x,200, bitmap, src_rect)
    draw_actor_name(@actor,160, 0)
    draw_actor_class(@actor,5, 0)
    draw_actor_level(@actor, 160, 32)
    draw_actor_state(@actor, 300, 0)
    draw_actor_hp(@actor, 70, 60, 172)
    draw_actor_sp(@actor, 70, 90, 172)
    draw_actor_parameter(@actor, 300, 180, 0)
    draw_actor_parameter(@actor, 300, 210, 1)
    draw_actor_parameter(@actor, 300, 240, 2)
    draw_actor_parameter(@actor, 70, 120, 3)
    draw_actor_parameter(@actor, 70, 150, 4)
    draw_actor_parameter(@actor, 300, 120, 5)
    draw_actor_parameter(@actor, 300, 150, 6)
    self.contents.font.color = system_color
    self.contents.draw_text(300, 60, 60, 32, "经验值")
    self.contents.draw_text(300, 90, 90, 32, "距下一级")
    self.contents.font.color = normal_color
    self.contents.draw_text(300 + 100, 60, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(300 + 100, 90, 84, 32, @actor.next_rest_exp_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(300, 270, 96, 32, "装备")
    draw_item_name($data_weapons[@actor.weapon_id], 440, 300)  #武器
    draw_item_name($data_armors[@actor.armor1_id], 300, 400)   #项链
    draw_item_name($data_armors[@actor.armor2_id], 440, 350)   #帽子
    draw_item_name($data_armors[@actor.armor3_id], 300, 300)   #衣服
    draw_item_name($data_armors[@actor.armor4_id], 300, 350)   #鞋子
  end

end
仿大话脚本

作者: sun1007    时间: 2011-8-26 18:07
liuziyuan201019 发表于 2011-8-26 08:41
#==============================================================================
# ■ Window_Status
# ...

谢谢您的热心回答,我已经修改好了,修改window_base和Window_Status:)




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1