Project1
标题:
关于更改字的颜色
[打印本页]
作者:
步兵中尉
时间:
2008-9-26 08:06
标题:
关于更改字的颜色
用脚本更改菜单中字的颜色,可是最近突然忘了改法,还请诸位多指教。
要改的菜单
self.contents.font.color = system_color
self.contents.font.size = 16
self.contents.draw_text(x - 35, y - 7, 44, 32, $data_system.words.atk)
self.contents.draw_text(x - 35, y + 10, 44, 32, $data_system.words.pdef)
self.contents.draw_text(x - 35, y + 27, 44, 32, $data_system.words.mdef)
self.contents.font.color = normal_color
self.contents.font.size = 20
self.contents.draw_text(x - 55, y + 50, 160, 32, actor.name)
self.contents.font.size = 16
self.contents.draw_text(x-10, y - 7, 36, 32, actor.atk.to_s, 2)
self.contents.draw_text(x-10, y + 10, 36, 32, actor.pdef.to_s, 2)
self.contents.draw_text(x-10, y + 27, 36, 32, actor.mdef.to_s, 2)
if @actor_index == i
if @new_atk != nil
@color_box[0] = @new_atk <=> actor.atk
self.contents.font.size = 12
self.contents.font.color = system_color
self.contents.draw_text(x+12, y-7, 40, 32, "→", 1)
self.contents.font.size = 16
self.contents.font.color = @color_box[0] == -1 ? Color.new(0,255,0) : (@color_box[0] == 1 ? Color.new(255,0,0) : normal_color)
self.contents.draw_text(x+24, y-7, 36, 32, @new_atk.to_s, 2)
end
if @new_pdef != nil
@color_box[1] = @new_pdef <=> actor.pdef
self.contents.font.size = 12
self.contents.font.color = system_color
self.contents.draw_text(x+12, y+10, 40, 32, "→", 1)
self.contents.font.size = 16
self.contents.font.color = @color_box[1] == -1 ? Color.new(0,255,0) : (@color_box[1] == 1 ? Color.new(255,0,0) : normal_color)
self.contents.draw_text(x+24, y+10, 36, 32, @new_pdef.to_s, 2)
end
if @new_mdef != nil
@color_box[2] = @new_mdef <=> actor.mdef
self.contents.font.size = 12
self.contents.font.color = system_color
self.contents.draw_text(x+12, y+27, 40, 32, "→", 1)
self.contents.font.size = 16
self.contents.font.color = @color_box[2] == -1 ? Color.new(0,255,0) : (@color_box[2] == 1 ? Color.new(255,0,0) : normal_color)
self.contents.draw_text(x+24, y+27, 36, 32, @new_mdef.to_s, 2)
end
end
end
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