Project1

标题: 多重状态交替显示文字型的问题 [打印本页]

作者: 柳飛鷹    时间: 2010-8-1 17:43
标题: 多重状态交替显示文字型的问题
http://rpg.blue/forum.php?mod=vi ... p;page=1#pid1470257
传送门中的的多重状态交替显示文字型可否运用到windows_help的人物状态显示中?可以的话,求修改方法。
作者: 柳飛鷹    时间: 2010-8-1 18:17
在线等……
作者: 柳飛鷹    时间: 2010-8-2 12:12
顶起
作者: 柳飛鷹    时间: 2010-8-2 16:39
顶起

作者: 逸豫    时间: 2010-8-2 17:45
  1. #==============================================================================
  2. # ■ Window_Help
  3. #------------------------------------------------------------------------------
  4. #  特技及物品的说明、角色的状态显示的窗口。
  5. #==============================================================================

  6. class Window_Help < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 0, 640, 64)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.   end
  14.   #--------------------------------------------------------------------------
  15.   # ● 设置文本
  16.   #     text  : 窗口显示的字符串
  17.   #     align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐)
  18.   #--------------------------------------------------------------------------
  19.   def set_text(text, align = 0)
  20.     # 如果文本和对齐方式的至少一方与上次的不同
  21.     if text != @text or align != @align
  22.       # 再描绘文本
  23.       self.contents.clear
  24.       self.contents.font.color = normal_color
  25.       self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
  26.       @text = text
  27.       @align = align
  28.       @actor = nil
  29.     end
  30.     self.visible = true
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● 设置角色
  34.   #     actor : 要显示状态的角色
  35.   #--------------------------------------------------------------------------
  36.   def set_actor(actor)
  37.     if actor != @actor
  38.       self.contents.clear
  39.       draw_actor_name(actor, 4, 0)
  40.       #draw_actor_state(actor, 140, 0)
  41.       @xt = States_Txt.new(actor.states,140,0,40) if @xt == nil
  42.       draw_actor_hp(actor, 284, 0)
  43.       draw_actor_sp(actor, 460, 0)
  44.       @actor = actor
  45.       @text = nil
  46.       self.visible = true
  47.     end
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● 设置敌人
  51.   #     enemy : 要显示名字和状态的敌人
  52.   #--------------------------------------------------------------------------
  53.   def set_enemy(enemy)
  54.     text = enemy.name
  55.     #state_text = make_battler_state_text(enemy, 112, false)
  56.     #if state_text != ""
  57.     #  text += "  " + state_text
  58.     #end
  59.     set_text(text, 1)
  60.     @xt = States_Txt.new(enemy.states,0,0,40) if @xt == nil
  61.     #p @xt
  62.   end
  63.   def visible=(v)
  64.     @xt.visible = v if @xt != nil  
  65.     super
  66.   end
  67.   def update
  68.     @xt.update if @xt != nil
  69.     super
  70.   end
  71.   def dispose
  72.     @xt.dispose
  73.     super
  74.   end
  75. end
复制代码
这个脚本扔main上面
Arrow_Base中找到这一行:
update_help
下面加一句
@help_window.update





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