Project1

标题: 如何更改战斗结束窗口文字位置? [打印本页]

作者: 晓风曦和    时间: 2010-6-28 16:07
标题: 如何更改战斗结束窗口文字位置?
柳大人在http://rpg.blue/portal.php?mod=view&aid=40520中所提到的灵魄引入中,说“具体描绘时候的窗口文字位置不是本次教学重点,不多介绍”,可是这样的话战斗结束后灵魄会重叠在金钱上,如何将它移动到下面来呢?
作者: 紫苏    时间: 2010-7-4 12:05
在 Window_BattleResult 中:
  def initialize(exp, gold, treasures)
    @exp = exp
    @gold = gold
    @treasures = treasures
    super(160, 0, 320, @treasures.size * 32 + 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.y = 160 - height / 2
    self.back_opacity = 160
    self.visible = false
    refresh
  end
作者: 晓风曦和    时间: 2010-7-9 09:08
本帖最后由 晓风曦和 于 2010-7-9 09:20 编辑
在 Window_BattleResult 中:
  def initialize(exp, gold, treasures)
    @exp = exp
    @gold = gold
    @treasures = treasures
    super(160, 0, 320, @treasures.size * 32 + 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.y = 160 - height / 2
    self.back_opacity = 160
    self.visible = false
    refresh
  end

Thank you very much!!!(《黑暗圣剑》里雪国之城居然用英语对话,看来我只学到初三英语还要苦练呐!)可是你调整的是窗口,我要的是文字!我已经找到,是#--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    x = 4
    self.contents.font.color = normal_color
    cx = contents.text_size(@exp.to_s).width
    self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
    x += cx + 4
    self.contents.font.color = system_color
    cx = contents.text_size("经验值").width
    self.contents.draw_text(x, 0, 64, 32, "经验值")
    x += cx + 16
    self.contents.font.color = normal_color
    cx = contents.text_size(@gold.to_s).width
    self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
    x += cx + 4
    self.contents.font.color = system_color
    self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
    y = 32
    self.contents.font.color = normal_color
    self.contents.draw_text(25,25,128-64,32,$game_variables[25].to_s,2)
    self.contents.font.color = system_color
    self.contents.draw_text(25,25,128,32,"灵魄",2)
    y = 64





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