Project1

标题: 我的帮助窗口的字出框了 [打印本页]

作者: zxc3824    时间: 2010-11-27 22:40
标题: 我的帮助窗口的字出框了
上图先

(图上不了。。。。。。)

发我的帮助代码,然后自己复制上去吧。

#==============================================================================
# ■ Window_Help
#------------------------------------------------------------------------------
#  特技及物品的说明、角色的状态显示的窗口。
#==============================================================================

class Window_Help < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize
    super(320, 160, 320, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # ● 设置文本
  #     text  : 窗口显示的字符串
  #     align : 对齐方式 (0..左对齐、1..中间对齐、2..右对齐)
  #--------------------------------------------------------------------------
  def set_text(text, align = 0)
    # 如果文本和对齐方式的至少一方与上次的不同
    if text != @text or align != @align
      # 再描绘文本
      self.contents.clear
      self.contents.font.color = text_color(8)
      self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
      @text = text
      @align = align
      @actor = nil
    end
    self.visible = true
  end
  #--------------------------------------------------------------------------
  # ● 设置角色
  #     actor : 要显示状态的角色
  #--------------------------------------------------------------------------
  def set_actor(actor)
    if actor != @actor
      self.contents.clear
      draw_actor_name(actor, 4, 0)
      draw_actor_state(actor, 140, 0)
      draw_actor_hp(actor, 284, 0)
      draw_actor_sp(actor, 460, 0)
      @actor = actor
      @text = nil
      self.visible = true
    end
  end
  #--------------------------------------------------------------------------
  # ● 设置敌人
  #     enemy : 要显示名字和状态的敌人
  #--------------------------------------------------------------------------
  def set_enemy(enemy)
    text = enemy.name
    state_text = make_battler_state_text(enemy, 112, false)
    if state_text != ""
      text += "  " + state_text
    end
    set_text(text, 1)
  end
end



作者: wbsy8241    时间: 2010-11-28 01:16
本帖最后由 wbsy8241 于 2010-11-28 01:45 编辑

super(320, 160, 320, 160)

super里的4个意思是
super(X坐标,  Y坐标,  长,  宽)

你描到 Y坐标160 那去了






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