Project1

标题: 怎样让主菜单的一些选项改变文字颜色。 [打印本页]

作者: 白魔导师宝儿    时间: 2018-2-25 10:14
标题: 怎样让主菜单的一些选项改变文字颜色。
我想把物品跟技能的文字改为红色字表示,存档改为蓝色字表示。
请问怎么做到?
作者: 梦无笙    时间: 2018-2-25 10:14
  1. class Window_Command < Window_Selectable
  2.   def draw_item(index,enabled = true)
  3.     rect = item_rect(index)
  4.     rect.x += 4
  5.     rect.width -= 8
  6.     self.contents.clear_rect(rect)
  7.     self.contents.font.color = normal_color
  8.     self.contents.font.color.alpha = enabled ? 255 : 128
  9.    
  10.     #以下3组“”内的文字要与你游戏设置的一致
  11.     case @commands[index]
  12.       when "存档"
  13.         self.contents.font.color = text_color(12)
  14.       when "物品","特技"
  15.         self.contents.font.color = text_color(10)
  16.     end
  17.     #=======================================
  18.    
  19.     self.contents.draw_text(rect, @commands[index])  
  20.   end
  21. end
复制代码





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