Project1
标题:
请问,如何在脚本中改变色调的?
[打印本页]
作者:
ad1234a
时间:
2011-7-7 03:48
标题:
请问,如何在脚本中改变色调的?
本帖最后由 ad1234a 于 2011-7-7 03:49 编辑
主要是想改变@Sprite = sprite.new这一类的色调(在Scene_File中改的)
以及能够使截图存档在每一个存档位都有截图的(我的方法的是临时方法,因此来求助一下大家):
#==============================================================================
# ■ Scene_File
#------------------------------------------------------------------------------
# 存档画面及读档画面的超级类。
#==============================================================================
class Scene_File
#--------------------------------------------------------------------------
# ● 初始化对像
# help_text : 帮助窗口显示的字符串
#--------------------------------------------------------------------------
def initialize(help_text)
@help_text = help_text
end
#--------------------------------------------------------------------------
# ● 主处理
#--------------------------------------------------------------------------
def main
# 生成帮助窗口
#@help_window = Window_Help.new
#@help_window.set_text(@help_text)
@back = Sprite.new
@command = Sprite.new
@command1 = Sprite.new
@command_1 = Sprite.new
@command_2 = Sprite.new
@command_3 = Sprite.new
@back.bitmap = Bitmap.new("Graphics/Pictures/苍之涛菜单·存读档")
@command.bitmap = Bitmap.new("Graphics/Pictures/苍之涛菜单·框一")
@command1.bitmap = Bitmap.new("Graphics/Pictures/苍之涛菜单·框二")
@command_1.bitmap = Bitmap.new("Graphics/Pictures/59-1")
@command_2.bitmap = Bitmap.new("Graphics/Pictures/59-1")
@command_3.bitmap = Bitmap.new("Graphics/Pictures/59-1")
@command.x = 0
@command.y = 10
@command1.x = 0
@command1.y = 550
@command_1.x = 100
@command_1.y = 70
@command_2.x = 100
@command_2.y = 224
@command_3.x = 100
@command_3.y = 378
@sprite = Sprite.new
@sprite2 = Sprite.new
@sprite3 = Sprite.new
if FileTest.exist?("Save/Save#{$game_temp.last_file_index + 1}.sav")
@sprite.bitmap = Bitmap.new("Save/Save#{$game_temp.last_file_index + 1}.jpg")
else
#@sprite.bitmap = RPG::Cache.picture("截图存档.png")
end
if FileTest.exist?("Save/Save2.sav")
@sprite2.bitmap = Bitmap.new("Save/Save2.jpg")
#if FileTest.exist?("Save/Save#{$game_temp.last_file_index + 2}.sav")
# @sprite2.bitmap = Bitmap.new("Save/Save#{$game_temp.last_file_index + 2}.jpg")
else
#@sprite.bitmap = RPG::Cache.picture("截图存档.png")
end
if FileTest.exist?("Save/Save3.sav")
@sprite3.bitmap = Bitmap.new("Save/Save3.jpg")
#if FileTest.exist?("Save/Save#{$game_temp.last_file_index + 1}.sav")
# @sprite3.bitmap = Bitmap.new("Save/Save#{$game_temp.last_file_index + 1}.jpg")
else
#@sprite.bitmap = RPG::Cache.picture("截图存档.png")
end
@sprite.zoom_x = 0.12
@sprite.zoom_y = 0.12
@sprite.x = 118
@sprite.y = -30 + 135
@sprite.z = 20
@sprite2.zoom_x = 0.12
@sprite2.zoom_y = 0.12
@sprite2.x = 118
@sprite2.y = -10 + 135 * 2
@sprite2.z = 20
@sprite3.zoom_x = 0.12
@sprite3.zoom_y = 0.12
@sprite3.x = 118
@sprite3.y = 5 + 135 * 3
@sprite3.z = 20
#t=tone.new(-102,-102,-102,0)
# 生成存档文件查
@savefile_windows = []
for i in 0..2
@savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
end
for i in @savefile_windows
i.opacity = 0
end
# 选择最后操作的文件
@file_index = $game_temp.last_file_index
@savefile_windows[@file_index].selected = true
# 执行过渡
Graphics.transition
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面被切换的话就中断循环
if $scene != self
break
end
end
# 准备过渡
Graphics.freeze
# 释放窗口
#@help_window.dispose
@back.dispose
@command.dispose
@command1.dispose
@command_1.dispose
@command_2.dispose
@command_3.dispose
@sprite.dispose
@sprite2.dispose
@sprite3.dispose
for i in @savefile_windows
i.dispose
end
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新窗口
@help_window.update
for i in @savefile_windows
i.update
end
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 调用过程 on_decision (定义继承目标)
on_decision(make_filename(@file_index))
$game_temp.last_file_index = @file_index
return
end
# 按下 B 键的情况下
if Input.trigger?(Input::B)
# 调用过程 on_cancel (定义继承目标)
on_cancel
return
end
# 按下方向键下的情况下
if Input.repeat?(Input::DOWN)
# 方向键下的按下状态不是重复的情况下、
# 并且光标的位置在 3 以前的情况下
if Input.trigger?(Input::DOWN) or @file_index < 3
# 演奏光标 SE
$game_system.se_play($data_system.cursor_se)
# 光标向下移动
@savefile_windows[@file_index].selected = false
@file_index = (@file_index + 1) % 3
@savefile_windows[@file_index].selected = true
return
end
end
# 按下方向键上的情况下
if Input.repeat?(Input::UP)
# 方向键上的按下状态不是重复的情况下、
# 并且光标的位置在 0 以后的情况下
if Input.trigger?(Input::UP) or @file_index > 0
# 演奏光标 SE
$game_system.se_play($data_system.cursor_se)
# 光标向上移动
@savefile_windows[@file_index].selected = false
@file_index = (@file_index + 2) % 3
@savefile_windows[@file_index].selected = true
return
end
end
end
#--------------------------------------------------------------------------
# ● 生成文件名
# file_index : 文件名的索引 (0~3)
#--------------------------------------------------------------------------
def make_filename(file_index)
return "Save/Save#{file_index + 1}.sav"
end
end
复制代码