Project1

标题: 关于更改字的颜色 [打印本页]

作者: 步兵中尉    时间: 2008-9-26 08:06
标题: 关于更改字的颜色
    用脚本更改菜单中字的颜色,可是最近突然忘了改法,还请诸位多指教。
要改的菜单
  1. self.contents.font.color = system_color
  2.       self.contents.font.size = 16
  3.       self.contents.draw_text(x - 35, y - 7, 44, 32, $data_system.words.atk)
  4.       self.contents.draw_text(x - 35, y + 10, 44, 32, $data_system.words.pdef)
  5.       self.contents.draw_text(x - 35, y + 27, 44, 32, $data_system.words.mdef)

  6.       self.contents.font.color = normal_color
  7.       self.contents.font.size = 20
  8.       self.contents.draw_text(x - 55, y + 50, 160, 32, actor.name)
  9.       self.contents.font.size = 16
  10.       self.contents.draw_text(x-10, y - 7, 36, 32, actor.atk.to_s, 2)
  11.       self.contents.draw_text(x-10, y + 10, 36, 32, actor.pdef.to_s, 2)
  12.       self.contents.draw_text(x-10, y + 27, 36, 32, actor.mdef.to_s, 2)
  13.       if @actor_index == i
  14.         if @new_atk != nil
  15.           @color_box[0] = @new_atk <=> actor.atk
  16.           self.contents.font.size = 12
  17.           self.contents.font.color = system_color
  18.           self.contents.draw_text(x+12, y-7, 40, 32, "→", 1)
  19.           self.contents.font.size = 16
  20.           self.contents.font.color = @color_box[0] == -1 ? Color.new(0,255,0) : (@color_box[0] == 1 ? Color.new(255,0,0) : normal_color)
  21.           self.contents.draw_text(x+24, y-7, 36, 32, @new_atk.to_s, 2)
  22.         end
  23.         if @new_pdef != nil
  24.           @color_box[1] = @new_pdef <=> actor.pdef
  25.           self.contents.font.size = 12
  26.           self.contents.font.color = system_color
  27.           self.contents.draw_text(x+12, y+10, 40, 32, "→", 1)
  28.           self.contents.font.size = 16
  29.           self.contents.font.color = @color_box[1] == -1 ? Color.new(0,255,0) : (@color_box[1] == 1 ? Color.new(255,0,0) : normal_color)
  30.           self.contents.draw_text(x+24, y+10, 36, 32, @new_pdef.to_s, 2)
  31.           end
  32.         if @new_mdef != nil
  33.           @color_box[2] = @new_mdef <=> actor.mdef
  34.           self.contents.font.size = 12
  35.           self.contents.font.color = system_color
  36.           self.contents.draw_text(x+12, y+27, 40, 32, "→", 1)
  37.           self.contents.font.size = 16
  38.           self.contents.font.color = @color_box[2] == -1 ? Color.new(0,255,0) : (@color_box[2] == 1 ? Color.new(255,0,0) : normal_color)
  39.           self.contents.draw_text(x+24, y+27, 36, 32, @new_mdef.to_s, 2)
  40.         end
  41.       end
  42.     end
  43.   end
复制代码
[LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 灯笼菜刀王    时间: 2008-9-26 10:16
draw_text前面加上self.contents.font.color.set(R,G,B,ALPHA)
作者: 黑鏻    时间: 2008-9-26 10:59
把self.contents.font.color = normal_color
换成self.contents.font.color.set(R,G,B,ALPHA)

颜色也可以在Window_Base里改 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~




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