Project1
标题:
[RM脚本] 改变游戏字体颜色的脚本
[打印本页]
作者:
大话三国
时间:
2006-11-7 13:32
提示:
作者被禁止或删除 内容自动屏蔽
作者:
大话三国
时间:
2006-11-7 13:32
提示:
作者被禁止或删除 内容自动屏蔽
作者:
RockK
时间:
2006-11-8 02:34
说明不够{/gg}
感觉这个脚本需要配合工程一起发布。
纯意见。
作者:
神思
时间:
2006-11-8 02:36
- -`||粘进去就好了..然后
$scene = Text_color.new
用了一下..感觉不太好啊...
改完后如果不满意想再改.再进去他又会变成255,255,255..而且按的又慢- -`||
作者:
神思
时间:
2006-11-8 03:25
无聊改了一下``
{/cy}这样就可以保留上次修改过的颜色``~~
颜色也会跟着储存被保存起来``~~
#===================================
# Script by Corbaque
#---------------------------------------------------------------
# 04 / 07 / 2006
#---------------------------------------------------------------
# This script is used to modify the color of the texts
# In the game
#===================================
class Text_color
#-------------------------------------------------------------
# Methode d'appel - Définition des variable
#-------------------------------------------------------------
def initialize
if defined?(@color_proto) then @color_proto = $normal_c else
@color_proto = Color.new(255, 255, 255, 255)
@r = $normal_c.red#255
@v = $normal_c.green#255
@b = $normal_c.blue#255
@o = $normal_c.alpha#255
end
@i = 0
@color_pulse = 0
end
def main
#-----------------------------------------------------------
# Methode Maître - Définition des fenêtre,
# Boucle de mise à jour et suppression des
# Fenêtre (lorsque qu'une autre classe est
# Appelée
#-----------------------------------------------------------
@demo = Window_Base.new(0, 0, 640, 480)
@demo.contents = Bitmap.new(608, 442)
@demo.contents.font.name = $fontface
@demo.contents.font.size = 50
@demo.contents.font.bold = true
@selec = Window_Command.new(400,
["红", "绿", "蓝", "透明度", "默认", "样式 =>"])
@selec.x = 120
@selec.y = 200
@jauge = Window_Base.new(0, 0, 280, @selec.height)
@jauge.contents = Bitmap.new(@selec.width, @selec.height)
@jauge.contents.font.name = $fontface
@jauge.contents.font.size = 22
@jauge.x = 220
@jauge.y = 200
@jauge.opacity = @jauge.back_opacity = 0
Graphics.transition
while $scene == self
Graphics.update
Input.update
update
end
Graphics.freeze
@demo.dispose
@jauge.dispose
@selec.dispose
end
#-------------------------------------------------------------
# Methode de mise à jour
#-------------------------------------------------------------
def update
# Mise à jour des fenêtres
@color_proto = Color.new(@r, @v, @b, @o)
@demo.contents.clear
@demo.contents.font.color = @color_proto
@demo.contents.draw_text(250, 4, 200, 96, "样式")
@demo.update
@jauge.contents.clear
# Ce code monstre est en faite tout simple, chacune de ces lignes
# Servent à tracer un fill (ligne) et sont classés de manière à faire
# Des jauges, ce code est en quatre parties.
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Jauge de rouge
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@jauge.contents.fill_rect(4, 8, 240, 1, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 9, 240, 1, Color.new(100, 100, 100, 255))
@jauge.contents.fill_rect(4, 10, 240, 1, Color.new(200, 200, 200, 255))
@jauge.contents.fill_rect(4, 11, 240, 1, Color.new(255, 255, 255, 255))
@jauge.contents.fill_rect(4, 12, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 16, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 17, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 21, 240, 1, Color.new(255, 255, 255, 255))
@jauge.contents.fill_rect(4, 22, 240, 1, Color.new(200, 200, 200, 255))
@jauge.contents.fill_rect(4, 23, 240, 1, Color.new(100, 100, 100, 255))
@jauge.contents.fill_rect(4, 24, 240, 1, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 12, @r * 240 / 255, 2, Color.new(@r, 0, 0, 105))
@jauge.contents.fill_rect(4, 14, @r * 240 / 255, 2, Color.new(@r, 0, 0, 255))
@jauge.contents.fill_rect(4, 16, @r * 240 / 255, 2, Color.new(@r, 0, 0, 255))
@jauge.contents.fill_rect(4, 18, @r * 240 / 255, 2, Color.new(@r, 0, 0, 105))
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Jauge de vert
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@jauge.contents.fill_rect(4, 32 + 8, 240, 1, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 32 + 9, 240, 1, Color.new(100, 100, 100, 255))
@jauge.contents.fill_rect(4, 32 + 10, 240, 1, Color.new(200, 200, 200, 255))
@jauge.contents.fill_rect(4, 32 + 11, 240, 1, Color.new(255, 255, 255, 255))
@jauge.contents.fill_rect(4, 32 + 12, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 32 + 16, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 32 + 17, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 32 + 21, 240, 1, Color.new(255, 255, 255, 255))
@jauge.contents.fill_rect(4, 32 + 22, 240, 1, Color.new(200, 200, 200, 255))
@jauge.contents.fill_rect(4, 32 + 23, 240, 1, Color.new(100, 100, 100, 255))
@jauge.contents.fill_rect(4, 32 + 24, 240, 1, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 32 + 12, @v * 240 / 255, 2, Color.new(0, @v, 0, 105))
@jauge.contents.fill_rect(4, 32 + 14, @v * 240 / 255, 2, Color.new(0, @v, 0, 255))
@jauge.contents.fill_rect(4, 32 + 16, @v * 240 / 255, 2, Color.new(0, @v, 0, 255))
@jauge.contents.fill_rect(4, 32 + 18, @v * 240 / 255, 2, Color.new(0, @v, 0, 105))
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Jauge de bleu
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@jauge.contents.fill_rect(4, 64 + 8, 240, 1, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 64 + 9, 240, 1, Color.new(100, 100, 100, 255))
@jauge.contents.fill_rect(4, 64 + 10, 240, 1, Color.new(200, 200, 200, 255))
@jauge.contents.fill_rect(4, 64 + 11, 240, 1, Color.new(255, 255, 255, 255))
@jauge.contents.fill_rect(4, 64 + 12, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 64 + 16, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 64 + 17, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 64 + 21, 240, 1, Color.new(255, 255, 255, 255))
@jauge.contents.fill_rect(4, 64 + 22, 240, 1, Color.new(200, 200, 200, 255))
@jauge.contents.fill_rect(4, 64 + 23, 240, 1, Color.new(100, 100, 100, 255))
@jauge.contents.fill_rect(4, 64 + 24, 240, 1, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 64 + 12, @b * 240 / 255, 2, Color.new(0, 0, @b, 105))
@jauge.contents.fill_rect(4, 64 + 14, @b * 240 / 255, 2, Color.new(0, 0, @b, 255))
@jauge.contents.fill_rect(4, 64 + 16, @b * 240 / 255, 2, Color.new(0, 0, @b, 255))
@jauge.contents.fill_rect(4, 64 + 18, @b * 240 / 255, 2, Color.new(0, 0, @b, 105))
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Jauge d'opacitée
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@jauge.contents.fill_rect(4, 96 + 8, 240, 1, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 96 + 9, 240, 1, Color.new(100, 100, 100, 255))
@jauge.contents.fill_rect(4, 96 + 10, 240, 1, Color.new(200, 200, 200, 255))
@jauge.contents.fill_rect(4, 96 + 11, 240, 1, Color.new(255, 255, 255, 255))
@jauge.contents.fill_rect(4, 96 + 12, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 96 + 16, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 96 + 17, 240, 4, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 96 + 21, 240, 1, Color.new(255, 255, 255, 255))
@jauge.contents.fill_rect(4, 96 + 22, 240, 1, Color.new(200, 200, 200, 255))
@jauge.contents.fill_rect(4, 96 + 23, 240, 1, Color.new(100, 100, 100, 255))
@jauge.contents.fill_rect(4, 96 + 24, 240, 1, Color.new(0, 0, 0, 255))
@jauge.contents.fill_rect(4, 96 + 12, @o * 240 / 255, 2, Color.new(150, 150, 150, @o))
@jauge.contents.fill_rect(4, 96 + 14, @o * 240 / 255, 2, Color.new(255, 255, 255, @o))
@jauge.contents.fill_rect(4, 96 + 16, @o * 240 / 255, 2, Color.new(255, 255, 255, @o))
@jauge.contents.fill_rect(4, 96 + 18, @o * 240 / 255, 2, Color.new(150, 150, 150, @o))
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Couleur en question
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
case @i
when 0
@jauge.contents.draw_text(4, 128, 100, 96, "Base")
when 1
@jauge.contents.draw_text(4, 128, 200, 96, "Systême")
when 2
@jauge.contents.draw_text(4, 128, 200, 96, "Desactivé")
when 3
@jauge.contents.draw_text(4, 128, 200, 96, "Etat Critique")
when 4
@jauge.contents.draw_text(4, 128, 200, 96, "Mort")
end
@jauge.update
@selec.update
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# Celon l'index de la fenêtre,
# Auguementation, diminution et défauts des
# Différents variables, ou conclusion de la
# Classe (Appel du menu par défaut,
# Modifiable
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
case @selec.index
when 0
if Input.repeat?(Input::LEFT)
unless @r < 5
$game_system.se_play($data_system.cursor_se)
@r -= 5
return
end
$game_system.se_play($data_system.buzzer_se)
elsif Input.repeat?(Input::RIGHT)
unless @r > 250
$game_system.se_play($data_system.cursor_se)
@r += 5
return
end
$game_system.se_play($data_system.buzzer_se)
end
when 1
if Input.repeat?(Input::LEFT)
unless @v < 5
$game_system.se_play($data_system.cursor_se)
@v -= 5
return
end
$game_system.se_play($data_system.buzzer_se)
elsif Input.repeat?(Input::RIGHT)
unless @v > 250
$game_system.se_play($data_system.cursor_se)
@v += 5
return
end
$game_system.se_play($data_system.buzzer_se)
end
when 2
if Input.repeat?(Input::LEFT)
unless @b < 5
$game_system.se_play($data_system.cursor_se)
@b -= 5
return
end
$game_system.se_play($data_system.buzzer_se)
elsif Input.repeat?(Input::RIGHT)
unless @b > 250
$game_system.se_play($data_system.cursor_se)
@b += 5
return
end
$game_system.se_play($data_system.buzzer_se)
end
when 3
if Input.repeat?(Input::LEFT)
unless @o < 5
$game_system.se_play($data_system.cursor_se)
@o -= 5
return
end
$game_system.se_play($data_system.buzzer_se)
elsif Input.repeat?(Input::RIGHT)
unless @o > 250
$game_system.se_play($data_system.cursor_se)
@o += 5
return
end
$game_system.se_play($data_system.buzzer_se)
end
when 4
if Input.trigger?(Input::C)
$game_system.se_play($data_system.cursor_se)
@r = 255
@v = 255
@b = 255
@o = 255
end
when 5
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
unless @i == 0
@i -= 1
return
end
@i = 4
elsif Input.repeat?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@i += 1
@i %= 5
end
end
if Input.trigger?(Input::C)
unless @selec.index == 4
case @i
when 0
$normal_c = @color_proto
when 1
$system_c = @color_proto
when 2
$disable_c = @color_proto
when 3
$crisis_c = @color_proto
when 4
$die_c = @color_proto
end
#Replace this line by calls scene which
# you wish, example :
# $scene = Scene_Map.new
$scene = Scene_Menu.new
end
end
if @selec.index == -1
@selec.index = 0
end
@selec.refresh
end
end
#===================================
# Add-on at Window_Base
#===================================
class Window_Base < Window
def normal_color
return $normal_c
end
def disabled_color
return $disable_c
end
def system_color
return $system_c
end
def crisis_color
return $crisis_c
end
def knockout_color
return $die_c
end
end
class Scene_Save < Scene_File
alias wr write_save_data
def write_save_data(file)
wr(file)
Marshal.dump($normal_c, file)
end
end
class Scene_Load < Scene_File
alias wr read_save_data
def read_save_data(file)
wr(file)
$normal_c = Marshal.load(file)
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1