Project1
标题:
求高手帮忙修改一下标题图形脚本
[打印本页]
作者:
永恒的路比
时间:
2013-1-31 13:03
标题:
求高手帮忙修改一下标题图形脚本
本帖最后由 hcm 于 2013-2-14 14:10 编辑
之前有人帮我弄了一个脚本但是我觉的不怎么好所以想换一下标题图形,只显示一个图形而不是几张图片随机播放..表示不怎么喜欢求高手帮忙一下
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
# 处理标题画面的类。
#==============================================================================
class Scene_Title
#--------------------------------------------------------------------------
# ● 住处理
#--------------------------------------------------------------------------
def main
# 战斗测试的情况下
if $BTEST
battle_test
return
end
# 载入数据库
$data_actors = load_data("Data/Actors.rxdata")
$data_classes = load_data("Data/Classes.rxdata")
$data_skills = load_data("Data/Skills.rxdata")
$data_items = load_data("Data/Items.rxdata")
$data_weapons = load_data("Data/Weapons.rxdata")
$data_armors = load_data("Data/Armors.rxdata")
$data_enemies = load_data("Data/Enemies.rxdata")
$data_troops = load_data("Data/Troops.rxdata")
$data_states = load_data("Data/States.rxdata")
$data_animations = load_data("Data/Animations.rxdata")
$data_tilesets = load_data("Data/Tilesets.rxdata")
$data_common_events = load_data("Data/CommonEvents.rxdata")
$data_system = load_data("Data/System.rxdata")
sfzx = false
f = File.open("Game.ini", "r")
$lines = f.readlines
f.close
for i in 0..$lines.size
if "#{$lines[i]}"[/true/] == "true" and "#{$lines[i]}"[/online=/] == "online="
sfzx = true
else
#.
end
end
#gg =
f = File.open("Data/Related.rxdata", "r")
$lines = f.readlines
f.close
if sfzx == true
gg = EasyConv.s2u(Win32API.new('dll.dll','HTTP',%w(p),'p').call($lines[1]))
else
gg = ""
end
#p $lines[0]
#p $lines[1]
#[url]http://marssq.360baba.com/pokemon/gg.txt[/url]
# 生成系统对像
$game_system = Game_System.new
# 生成标题图形
temp_sjs = rand(11)
@Backdrop = Sprite.new
@Backdrop.bitmap = RPG::Cache.title("title_#{temp_sjs}")
@logo = Sprite.new
@logo.bitmap = RPG::Cache.title("logo")
@logo.ox = @logo.bitmap.width/2
@logo.oy = @logo.bitmap.height/2
@logo.x = 640/2
@logo.y = 480/2-120
[url=home.php?mod=space&uid=114926]@sprite[/url] = Sprite.new
@Backdrop.opacity = 10
@sprite.bitmap = RPG::Cache.title($data_system.title_name)
@sprite.ox = @sprite.bitmap.width/2
@sprite.oy = @sprite.bitmap.height/2
@sprite.x = 640/2
@sprite.y = 480/2+120
@new_game = Sprite.new
#显示公告
wenzi_text = Sprite.new
wenzi_text.bitmap = Bitmap.new(640,480)
wenzi_text.bitmap.font.size = 18
wenzi_text.bitmap.font.color = Color.new(0, 0, 0, 255)
wenzi_text.bitmap.draw_text(248,59,640,480,"#{gg}")
#@continue_game = Sprite.new
#@quit_game = Sprite.new
#@Discuss_game = Sprite.new
@new_game.bitmap = RPG::Cache.title("button/Game_0.png")
@new_game.ox = @new_game.bitmap.width/2
@new_game.oy = @new_game.bitmap.height/2
@new_game.x = 640/2-140
@new_game.y = 480/2+120
# 生成命令窗口
s1 = " 开始游戏"
s2 = " 继续游戏"
s3 = " 离开游戏"
s4 = " 讨论游戏"
@command_window = Window_Command.new(192, [s1, s2, s3,s4])
@command_window.visible = false#back_opacity = 0
@command_window.x = 0 #320- @command_window.width / 2
@command_window.y = 0#320
# 判定继续的有效性
# 存档文件一个也不存在的时候也调查
# 有効为 @continue_enabled 为 true、無効为 false
@continue_enabled = false
for i in 0..3
if FileTest.exist?("savefile.rxdata")
@continue_enabled = true
end
end
# 继续为有效的情况下、光标停止在继续上
# 无效的情况下、继续的文字显示为灰色
if @continue_enabled
@command_window.index = 1
else
@command_window.disable_item(1)
end
# 演奏标题 BGM
$game_system.bgm_play($data_system.title_bgm)
# 停止演奏 ME、BGS
Audio.me_stop
Audio.bgs_stop
# 执行过渡
Graphics.transition
@rb_loop = 1
@rb_loop_wait = 0
# 主循环
loop do
# 刷新游戏画面
Graphics.update
# 刷新背景图
refresh_Backdrop
# 刷新输入信息
Input.update
# 刷新画面
update
# 如果画面被切换就中断循环
if $scene != self
break
end
end
# 装备过渡
Graphics.freeze
# 释放命令窗口
@command_window.dispose
# 释放标题图形
@sprite.bitmap.dispose
@sprite.dispose
@Backdrop.bitmap.dispose
@Backdrop.dispose
@new_game.dispose
@new_game.bitmap.dispose
@logo.dispose
@logo.bitmap.dispose
wenzi_text.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
# 刷新命令窗口
@command_window.update
@new_game.bitmap = RPG::Cache.title("button/Game_#{@command_window.index}.png")
# 按下 C 键的情况下
if Input.trigger?(Input::C)
# 命令窗口的光标位置的分支
case @command_window.index
when 0 # 新游戏
command_new_game
when 1 # 继续
command_continue
when 2 # 退出
command_shutdown
when 3
command_ximxi
end
end
end
#--------------------------------------------------------------------------
# ● 刷新 : 背景图
#--------------------------------------------------------------------------
def refresh_Backdrop
if @rb_loop_wait == 80
@rb_loop_wait = 0
@Backdrop.opacity = 10
#@sprite.bitmap = RPG::Cache.title("title_#{@rb_loop}.png")
@Backdrop.bitmap = RPG::Cache.title("title_#{@rb_loop}")
if @rb_loop >= 10
@rb_loop = 0
else
@rb_loop += 1
end
elsif @rb_loop_wait <= 80
@rb_loop_wait += 1
@Backdrop.opacity += 10
end
end
#--------------------------------------------------------------------------
# ● 命令 : 相关信息
#--------------------------------------------------------------------------
def command_ximxi
$marssq_com = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')
$marssq_com.call(0, 'open',$lines[0],0, 0, 1)
end
#--------------------------------------------------------------------------
# ● 命令 : 新游戏
#--------------------------------------------------------------------------
def command_new_game
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 停止 BGM
Audio.bgm_stop
# 重置测量游戏时间用的画面计数器
Graphics.frame_count = 0
# 生成各种游戏对像
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# 设置初期同伴位置
$game_party.setup_starting_members
# 设置初期位置的地图
$game_map.setup($data_system.start_map_id)
# 主角向初期位置移动
$game_player.moveto($data_system.start_x, $data_system.start_y)
# 刷新主角
$game_player.refresh
# 执行地图设置的 BGM 与 BGS 的自动切换
$game_map.autoplay
# 刷新地图 (执行并行事件)
$game_map.update
# 切换地图画面
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# ● 命令 : 继续
#--------------------------------------------------------------------------
def command_continue
# 继续无效的情况下
unless @continue_enabled
# 演奏无效 SE
$game_system.se_play($data_system.buzzer_se)
return
end
#========================================================================
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 停止 BGM
Audio.bgm_stop
# 重置测量游戏时间用的画面计数器
Graphics.frame_count = 0
# 生成各种游戏对像
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# 读取存档
file = File.open("savefile.rxdata", "rb")
read_save_data(file)
file.close
# 还原 BGM、BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# 刷新地图 (执行并行事件)
$game_map.update
# 切换到地图画面
$scene = Scene_Map.new
#========================================================================
end
#--------------------------------------------------------------------------
# ● 命令 : 退出
#--------------------------------------------------------------------------
def command_shutdown
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# BGM、BGS、ME 的淡入淡出
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# 退出
$scene = nil
end
#--------------------------------------------------------------------------
# ● 命令 : 相关
#--------------------------------------------------------------------------
def command_look
# 继续无效的情况下
unless @continue_enabled
# 演奏无效 SE
$game_system.se_play($data_system.buzzer_se)
return
end
#========================================================================
# 演奏确定 SE
$game_system.se_play($data_system.decision_se)
# 停止 BGM
Audio.bgm_stop
# 重置测量游戏时间用的画面计数器
Graphics.frame_count = 0
# 生成各种游戏对像
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# 读取存档
file = File.open("savefile.rxdata", "rb")
read_save(file)
file.close
# 还原 BGM、BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# 刷新地图 (执行并行事件)
$game_map.update
# 切换到地图画面
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# ● 战斗测试
#--------------------------------------------------------------------------
def battle_test
# 载入数据库 (战斗测试用)
$data_actors = load_data("Data/BT_Actors.rxdata")
$data_classes = load_data("Data/BT_Classes.rxdata")
$data_skills = load_data("Data/BT_Skills.rxdata")
$data_items = load_data("Data/BT_Items.rxdata")
$data_weapons = load_data("Data/BT_Weapons.rxdata")
$data_armors = load_data("Data/BT_Armors.rxdata")
$data_enemies = load_data("Data/BT_Enemies.rxdata")
$data_troops = load_data("Data/BT_Troops.rxdata")
$data_states = load_data("Data/BT_States.rxdata")
$data_animations = load_data("Data/BT_Animations.rxdata")
$data_tilesets = load_data("Data/BT_Tilesets.rxdata")
$data_common_events = load_data("Data/BT_CommonEvents.rxdata")
$data_system = load_data("Data/BT_System.rxdata")
# 重置测量游戏时间用的画面计数器
Graphics.frame_count = 0
# 生成各种游戏对像
$game_temp = Game_Temp.new
$game_system = Game_System.new
$game_switches = Game_Switches.new
$game_variables = Game_Variables.new
$game_self_switches = Game_SelfSwitches.new
$game_screen = Game_Screen.new
$game_actors = Game_Actors.new
$game_party = Game_Party.new
$game_troop = Game_Troop.new
$game_map = Game_Map.new
$game_player = Game_Player.new
# 设置战斗测试用同伴
$game_party.setup_battle_test_members
# 设置队伍 ID、可以逃走标志、战斗背景
$game_temp.battle_troop_id = $data_system.test_troop_id
$game_temp.battle_can_escape = true
$game_map.battleback_name = $data_system.battleback_name
# 演奏战斗开始 BGM
$game_system.se_play($data_system.battle_start_se)
# 演奏战斗 BGM
$game_system.bgm_play($game_system.battle_bgm)
# 切换到战斗画面
$scene = Scene_Battle.new
end
#--------------------------------------------------------------------------
# ● 读取存档数据
# file : 读取用文件对像 (已经打开)
#--------------------------------------------------------------------------
def read_save_data(file)
# 读取描绘存档文件用的角色数据
characters = Marshal.load(file)
# 读取测量游戏时间用画面计数
Graphics.frame_count = Marshal.load(file)
# 读取各种游戏对像
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
# 魔法编号与保存时有差异的情况下
# (加入编辑器的编辑过的数据)
if $game_system.magic_number != $data_system.magic_number
# 重新装载地图
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
# 刷新同伴成员
$game_party.refresh
end
#--------------------------------------------------------------------------
# ● 读取存档数据2
# file : 读取用文件对像 (已经打开)
#--------------------------------------------------------------------------
def read_save(file)
# 读取描绘存档文件用的角色数据
characters = Marshal.load(file)
# 读取测量游戏时间用画面计数
Graphics.frame_count = Marshal.load(file)
# 读取各种游戏对像
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
# 魔法编号与保存时有差异的情况下
# (加入编辑器的编辑过的数据)
if $game_system.magic_number != $data_system.magic_number
# 重新装载地图
$game_map.setup(292)
$game_player.center($game_player.x, $game_player.y)
end
# 刷新同伴成员
$game_party.refresh
end
#========================================================================
end
复制代码
作者:
芯☆淡茹水
时间:
2013-1-31 14:01
只显示一张图片的话用默认的标题场景就可以了啊
作者:
永恒的路比
时间:
2013-1-31 14:04
芯☆淡茹水 发表于 2013-1-31 14:01
只显示一张图片的话用默认的标题场景就可以了啊
谢谢我已经弄好了 虽然有点麻烦不过现在已经没问题了
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1