Project1

标题: 怎么把血条上的具体数字去掉 [打印本页]

作者: 梦·林夕    时间: 2012-12-29 13:05
标题: 怎么把血条上的具体数字去掉
就是这个脚本:
http://rpg.blue/article-40421.html
作者: 羞射了    时间: 2012-12-29 14:11
搜索draw_text的地方,删掉就不显示了。
作者: 美丽晨露    时间: 2013-1-3 20:04
覆盖掉原来的脚本就可以了
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================
  4. class Window_Base < Window
  5.   def draw_actor_hp2222(actor, x, y, width = 100, height=8)
  6.     y+=3
  7.     olx = x
  8.     oly = y
  9.     w = width * actor.hp / [actor.maxhp,1].max
  10.     hp_color_1 = Color.new(255, 0, 0, 192)
  11.     hp_color_2 = Color.new(255, 255, 0, 192)
  12.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  13.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  14.     x -= 1
  15.     y += (height/4).floor
  16.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  17.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  18.     x -= 1
  19.     y += (height/4).ceil
  20.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  21.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  22.     x -= 1
  23.     y += (height/4).ceil
  24.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  25.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  26.     x = olx
  27.     y = oly-14   
  28.     # 描绘字符串 "HP"
  29.   #  self.contents.font.color = system_color
  30.   #  self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
  31.     # 计算描绘 MaxHP 所需的空间
  32.     if width - 32 >= 108
  33.       hp_x = x + width - 108
  34.       flag = true
  35.     elsif width - 32 >= 48
  36.       hp_x = x + width - 48
  37.       flag = false
  38.     end
  39.     # 描绘 HP
  40.   #  self.contents.font.color = actor.hp == 0 ? knockout_color :
  41.   #    actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
  42.   #  self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
  43.     # 描绘 MaxHP
  44.     if flag
  45.       self.contents.font.color = normal_color
  46.       self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
  47.       self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
  48.     end   
  49.   end
  50.   def draw_actor_sp2222(actor, x, y, width = 100, height = 8)
  51.     y+=3
  52.     olx = x
  53.     oly = y
  54.     w = width * actor.sp / [actor.maxsp,1].max
  55.     hp_color_1 = Color.new( 0, 0, 255, 192)
  56.     hp_color_2 = Color.new( 0, 255, 255, 192)
  57.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  58.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  59.     x -= 1
  60.     y += (height/4).floor
  61.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  62.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  63.     x -= 1
  64.     y += (height/4).ceil
  65.     self.contents.fill_rect(x+8, y+4, width, (height/4).ceil , Color.new(0, 0, 0, 128))
  66.     draw_line(x, y, x + w, y, hp_color_1, (height/4).ceil , hp_color_2)
  67.     x -= 1
  68.     y += (height/4).ceil
  69.     self.contents.fill_rect(x+8, y+4, width, (height/4).floor, Color.new(0, 0, 0, 128))
  70.     draw_line(x, y, x + w, y, hp_color_1, (height/4).floor, hp_color_2)
  71.     x = olx
  72.     y = oly-14
  73.     # 描绘字符串 "SP"
  74.   #  self.contents.font.color = system_color
  75.   #  self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
  76.     # 计算描绘 MaxSP 所需的空间
  77.     if width - 32 >= 108
  78.       sp_x = x + width - 108
  79.       flag = true
  80.     elsif width - 32 >= 48
  81.       sp_x = x + width - 48
  82.       flag = false
  83.     end
  84.     # 描绘 SP
  85. #   self.contents.font.color = actor.sp == 0 ? knockout_color :
  86. #     actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
  87. #   self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
  88.     # 描绘 MaxSP
  89.     if flag
  90.       self.contents.font.color = normal_color
  91.       self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
  92.       self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
  93.     end   
  94.   end
  95.   #--------------------------------------------------------------------------
  96.   # ● ライン描画 by 桜雅 在土
  97.   #--------------------------------------------------------------------------
  98.   def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)
  99.     # 描写距離の計算。大きめに直角時の長さ。
  100.     distance = (start_x - end_x).abs + (start_y - end_y).abs
  101.     # 描写開始
  102.     if end_color == start_color
  103.       for i in 1..distance
  104.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  105.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  106.         if width == 1
  107.           self.contents.set_pixel(x, y, start_color)
  108.         else
  109.           self.contents.fill_rect(x, y, width, width, start_color)
  110.         end
  111.       end
  112.     else
  113.       for i in 1..distance
  114.         x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i
  115.         y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i
  116.         r = start_color.red * (distance-i)/distance + end_color.red * i/distance
  117.         g = start_color.green * (distance-i)/distance + end_color.green * i/distance
  118.         b = start_color.blue * (distance-i)/distance + end_color.blue * i/distance
  119.         a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance
  120.         if width == 1
  121.           self.contents.set_pixel(x, y, Color.new(r, g, b, a))
  122.         else
  123.           self.contents.fill_rect(x, y, width, width, Color.new(r, g, b, a))
  124.         end
  125.       end
  126.     end
  127.   end
  128. end
复制代码





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