Project1

标题: 怎么显示敌人血量的剩余值 [打印本页]

作者: 包包19930    时间: 2013-5-15 16:53
标题: 怎么显示敌人血量的剩余值
本帖最后由 hys111111 于 2013-6-28 12:27 编辑

怎么显示敌人血量的具体数字啊,不要什么血条的脚本了,求数字!
作者: 芯☆淡茹水    时间: 2013-5-16 00:09
复制以下脚本,插入到 main 前


RUBY 代码复制
  1. #==============================================================================
  2. class Window_Help < Window_Base
  3.   #--------------------------------------------------------------------------
  4.   def set_enemy(enemy)
  5.     self.contents.clear
  6.     self.contents.font.color = normal_color
  7.     self.contents.draw_text(10, 0, 146, 32, enemy.name)
  8.     self.contents.font.color = system_color
  9.     self.contents.draw_text(160, 0, 86, 32, "HP:")
  10.     self.contents.draw_text(390, 0, 86, 32, "SP:")
  11.     cx = contents.text_size(enemy.maxhp.to_s).width
  12.     bx = contents.text_size(enemy.hp.to_s).width
  13.     self.contents.font.color = normal_color
  14.     self.contents.draw_text(265 - bx, 0, bx, 32, enemy.hp.to_s)
  15.     self.contents.draw_text(270, 0, 32, 32, "/")
  16.     self.contents.draw_text(285, 0, cx, 32, enemy.maxhp.to_s)
  17.     dx = contents.text_size(enemy.maxsp.to_s).width
  18.     ex = contents.text_size(enemy.sp.to_s).width
  19.     self.contents.font.color = normal_color
  20.     self.contents.draw_text(485 - ex, 0, ex, 32, enemy.sp.to_s)
  21.     self.contents.draw_text(490, 0, 32, 32, "/")
  22.     self.contents.draw_text(505, 0, dx, 32, enemy.maxsp.to_s)
  23.     state_text = make_battler_state_text(enemy, 112, false)
  24.     if state_text != ""
  25.       text += "  " + state_text
  26.     end
  27.     text = enemy.name
  28.     set_text(text, 0)
  29.   end
  30.   #---------------------------------------------------------------------------
  31. end
  32. #==============================================================================




效果图:



作者: 包包19930    时间: 2013-5-16 21:08
哈哈,解决了,高手啊




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