Project1

标题: 选中选项后字体怎么变色 [打印本页]

作者: 公仪治    时间: 2022-5-27 00:55
标题: 选中选项后字体怎么变色
在window_selectable里没有看到修改字体颜色的地方。
作者: VIPArcher    时间: 2022-5-27 23:23
如果你是说要在显示选项里设置文本的颜色,那你可以用控制符例如 \c[1]
如果你是要光标选中的那行变色,那得改默认脚本,并且导致上面的控制符无法使用,不是很建议做这样的效果,
一定要这样做的话,可以参考如下代码未测试
  1. class Window_ChoiceList < Window_Command
  2.   def draw_item(index)
  3.     rect = item_rect_for_text(index)
  4.     change_color(index == self.index ? system_color : normal_color)
  5.     draw_text(rect.x, rect.y, rect.width, rect.height, command_name(index))
  6.   end
  7.   def update_cursor
  8.     super
  9.     refresh
  10.   end
  11. end
复制代码





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