Project1
标题:
关于标题菜单图标化的问题
[打印本页]
作者:
不是马甲
时间:
2010-9-22 17:24
标题:
关于标题菜单图标化的问题
我用了一个图标式标题 原本有三个选项 我给弄成四个了 但第四了显示不出来 也控制不了 大家能不能帮忙看看
#==============================================================================
# ■ 图片标题菜单1.0
# Scene_Title
#------------------------------------------------------------------------------
# 作者:chaochao
# http://zhuchao.go1.icpcn.com
#==============================================================================
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")
$game_system = Game_System.new
# 生成标题图形
@sprite = [Sprite.new]
for i in 0..8
@sprite[i] = Sprite.new
@sprite[i].opacity = 0
end
@sprite[0].bitmap = RPG::Cache.title($data_system.title_name)
@sprite[0].opacity = 0
#开始游戏的图片
@sprite[1].bitmap = Bitmap.new("Graphics/Begin/1.bmp")
@sprite[2].bitmap = Bitmap.new("Graphics/Begin/01.bmp")
#继续游戏的图片
@sprite[3].bitmap = Bitmap.new("Graphics/Begin/2.bmp")
@sprite[4].bitmap = Bitmap.new("Graphics/Begin/02.bmp")
#结束游戏的图片
@sprite[5].bitmap = Bitmap.new("Graphics/Begin/3.bmp")
@sprite[6].bitmap = Bitmap.new("Graphics/Begin/03.bmp")
@sprite[7].bitmap = Bitmap.new("Graphics/Begin/1.bmp")#exit1
@sprite[8].bitmap = Bitmap.new("Graphics/Begin/01.bmp")
#图片位置
for i in 1..8
case i
when 1..2
x=25
y=400
when 3..4
x=165
y=400
when 5..6
x=305
y=400
when 7..8
x=480
y=333
end
@sprite[i].x =x
@sprite[i].y =y
end
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
if @continue_enabled
@command_index = 1
else
@command_index = 0
@sprite[3].tone = Tone.new(0, 0, 0, 255)
@sprite[4].tone = Tone.new(0, 0, 0, 255)
end
$game_system.bgm_play($data_system.title_bgm)
Audio.me_stop
Audio.bgs_stop
Graphics.transition
loop do
Graphics.update
#淡出背景圖形
if @sprite[0].opacity <= 255
@sprite[0].opacity += 15
end
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
# 釋放圖形
for i in 0..8
@sprite[i].bitmap.dispose
@sprite[i].dispose
end
@sprite1.bitmap.dispose
@sprite1.dispose
end
def update
chaochaocommandchaochao
if Input.trigger?(Input::C)
case @command_index
when 0
command_new_game
when 1
command_continue
when 2
command_shutdown
when 3
command_shutdown
end
end
end
def chaochaocommandchaochao
if Input.trigger?(Input::LEFT)
@command_index -= 1
if @command_index < 0
@command_index = 2
end
$game_system.se_play($data_system.cursor_se)
end
if Input.trigger?(Input::RIGHT)
@command_index += 1
if @command_index > 2
@command_index = 0
end
$game_system.se_play($data_system.cursor_se)
end
case @command_index
when 0
if @sprite[1].opacity >= 0
@sprite[1].opacity -= 30
end
if @sprite[2].opacity <= 240
@sprite[2].opacity += 30
end
if @sprite[3].opacity <= 210
@sprite[3].opacity += 30
end
if @sprite[4].opacity >= 0
@sprite[4].opacity -= 30
end
if @sprite[5].opacity <= 210
@sprite[5].opacity += 30
end
if @sprite[6].opacity >= 0
@sprite[6].opacity -= 30
end
if @sprite[7].opacity >= 210
@sprite[7].opacity -= 30
end
if @sprite[8].opacity >= 0
@sprite[8].opacity -= 30
end
when 1
if @sprite[1].opacity <= 210
@sprite[1].opacity += 30
end
if @sprite[2].opacity >= 0
@sprite[2].opacity -= 30
end
if @sprite[3].opacity >= 0
@sprite[3].opacity -= 30
end
if @sprite[4].opacity <= 240
@sprite[4].opacity += 30
end
if @sprite[5].opacity <= 210
@sprite[5].opacity += 30
end
if @sprite[6].opacity >= 0
@sprite[6].opacity -= 30
end
if @sprite[7].opacity >= 210
@sprite[7].opacity -= 30
end
if @sprite[8].opacity >= 0
@sprite[8].opacity -= 30
end
when 2
if @sprite[1].opacity <= 210
@sprite[1].opacity += 30
end
if @sprite[2].opacity >= 0
@sprite[2].opacity -= 30
end
if @sprite[3].opacity <= 210
@sprite[3].opacity += 30
end
if @sprite[4].opacity >= 0
@sprite[4].opacity -= 30
end
if @sprite[5].opacity >= 0
@sprite[5].opacity -= 30
end
if @sprite[6].opacity <= 240
@sprite[6].opacity += 30
end
if @sprite[7].opacity >= 210
@sprite[7].opacity -= 30
end
if @sprite[8].opacity >= 0
@sprite[8].opacity -= 30
end
when 3
if @sprite[1].opacity <= 210
@sprite[1].opacity += 30
end
if @sprite[2].opacity >= 0
@sprite[2].opacity -= 30
end
if @sprite[3].opacity <= 210
@sprite[3].opacity += 30
end
if @sprite[4].opacity >= 0
@sprite[4].opacity -= 30
end
if @sprite[5].opacity >= 210
@sprite[5].opacity -= 30
end
if @sprite[6].opacity <= 0
@sprite[6].opacity += 30
end
if @sprite[7].opacity >= 0
@sprite[7].opacity -= 30
end
if @sprite[8].opacity >= 240
@sprite[8].opacity -= 30
end
end
end
end
复制代码
作者:
fux2
时间:
2010-9-22 17:43
本帖最后由 fux2 于 2010-9-22 18:55 编辑
改一下图片名字
#==============================================================================
# ■ 图片标题菜单1.0
# Scene_Title
#------------------------------------------------------------------------------
# 作者:chaochao
# http://zhuchao.go1.icpcn.com
#==============================================================================
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")
$game_system = Game_System.new
# 生成标题图形
@sprite = [Sprite.new]
for i in 0..8
@sprite[i] = Sprite.new
@sprite[i].opacity = 0
end
@sprite[0].bitmap = RPG::Cache.title($data_system.title_name)
@sprite[0].opacity = 0
#开始游戏的图片
@sprite[1].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
@sprite[2].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
#继续游戏的图片
@sprite[3].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
@sprite[4].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
#结束游戏的图片
@sprite[5].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
@sprite[6].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
@sprite[7].bitmap = Bitmap.new("Graphics/Begin/扳手.png")#exit1
@sprite[8].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
#图片位置
for i in 1..8
case i
when 1..2
x=25
y=400
when 3..4
x=165
y=400
when 5..6
x=305
y=400
when 7..8
x=480
y=400
end
@sprite[i].x =x
@sprite[i].y =y
end
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
if @continue_enabled
@command_index = 1
else
@command_index = 0
@sprite[3].tone = Tone.new(0, 0, 0, 255)
@sprite[4].tone = Tone.new(0, 0, 0, 255)
end
$game_system.bgm_play($data_system.title_bgm)
Audio.me_stop
Audio.bgs_stop
Graphics.transition
loop do
Graphics.update
#淡出背景圖形
if @sprite[0].opacity <= 255
@sprite[0].opacity += 15
end
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
# 釋放圖形
for i in 0..8
@sprite[i].bitmap.dispose
@sprite[i].dispose
end
# @sprite1.bitmap.dispose
# @sprite1.dispose
end
def update
chaochaocommandchaochao
if Input.trigger?(Input::C)
case @command_index
when 0
command_new_game
when 1
command_continue
when 2
command_shutdown
when 3
command_shutdown
end
end
end
def chaochaocommandchaochao
if Input.trigger?(Input::LEFT)
@command_index -= 1
if @command_index < 0
@command_index = 3
end
$game_system.se_play($data_system.cursor_se)
end
if Input.trigger?(Input::RIGHT)
@command_index += 1
if @command_index > 3
@command_index = 0
end
$game_system.se_play($data_system.cursor_se)
end
case @command_index
when 0
if @sprite[1].opacity >= 0
@sprite[1].opacity -= 30
end
if @sprite[2].opacity <= 240
@sprite[2].opacity += 30
end
if @sprite[3].opacity <= 210
@sprite[3].opacity += 30
end
if @sprite[4].opacity >= 0
@sprite[4].opacity -= 30
end
if @sprite[5].opacity <= 210
@sprite[5].opacity += 30
end
if @sprite[6].opacity >= 0
@sprite[6].opacity -= 30
end
if @sprite[7].opacity >= 210
@sprite[7].opacity -= 30
end
if @sprite[8].opacity >= 0
@sprite[8].opacity -= 30
end
when 1
if @sprite[1].opacity <= 210
@sprite[1].opacity += 30
end
if @sprite[2].opacity >= 0
@sprite[2].opacity -= 30
end
if @sprite[3].opacity >= 0
@sprite[3].opacity -= 30
end
if @sprite[4].opacity <= 240
@sprite[4].opacity += 30
end
if @sprite[5].opacity <= 210
@sprite[5].opacity += 30
end
if @sprite[6].opacity >= 0
@sprite[6].opacity -= 30
end
if @sprite[7].opacity >= 210
@sprite[7].opacity -= 30
end
if @sprite[8].opacity >= 0
@sprite[8].opacity -= 30
end
when 2
if @sprite[1].opacity <= 210
@sprite[1].opacity += 30
end
if @sprite[2].opacity >= 0
@sprite[2].opacity -= 30
end
if @sprite[3].opacity <= 210
@sprite[3].opacity += 30
end
if @sprite[4].opacity >= 0
@sprite[4].opacity -= 30
end
if @sprite[5].opacity >= 0
@sprite[5].opacity -= 30
end
if @sprite[6].opacity <= 240
@sprite[6].opacity += 30
end
if @sprite[7].opacity >= 210
@sprite[7].opacity -= 30
end
if @sprite[8].opacity >= 0
@sprite[8].opacity -= 30
end
when 3
if @sprite[1].opacity <= 210
@sprite[1].opacity += 30
end
if @sprite[2].opacity >= 0
@sprite[2].opacity -= 30
end
if @sprite[3].opacity <= 210
@sprite[3].opacity += 30
end
if @sprite[4].opacity >= 0
@sprite[4].opacity -= 30
end
if @sprite[5].opacity >= 210
@sprite[5].opacity -= 30
end
if @sprite[6].opacity <= 0
@sprite[6].opacity += 30
end
if @sprite[7].opacity >= 0
@sprite[7].opacity -= 30
end
if @sprite[8].opacity >= 240
@sprite[8].opacity -= 30
end
end
end
end
复制代码
作者:
zhuantou
时间:
2010-10-4 16:54
#==============================================================================
# ■ 图片标题菜单1.0
# Scene_Title
#------------------------------------------------------------------------------
# 作者:chaochao
# http://zhuchao.go1.icpcn.com
#==============================================================================
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")
$game_system = Game_System.new
# 生成标题图形
@sprite = [Sprite.new]
for i in 0..8
@sprite[i] = Sprite.new
@sprite[i].opacity = 0
end
@sprite[0].bitmap = RPG::Cache.title($data_system.title_name)
@sprite[0].opacity = 0
#开始游戏的图片
@sprite[1].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
@sprite[2].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
#继续游戏的图片
@sprite[3].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
@sprite[4].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
#结束游戏的图片
@sprite[5].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
@sprite[6].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
@sprite[7].bitmap = Bitmap.new("Graphics/Begin/扳手.png")#exit1
@sprite[8].bitmap = Bitmap.new("Graphics/Begin/扳手.png")
#图片位置
for i in 1..8
case i
when 1..2
x=25
y=400
when 3..4
x=165
y=400
when 5..6
x=305
y=400
when 7..8
x=480 #这里应该是445吧?
y=400
end
@sprite[i].x =x
@sprite[i].y =y
end
@continue_enabled = false
for i in 0..3
if FileTest.exist?("Save#{i+1}.rxdata")
@continue_enabled = true
end
end
if @continue_enabled
@command_index = 1
else
@command_index = 0
@sprite[3].tone = Tone.new(0, 0, 0, 255)
@sprite[4].tone = Tone.new(0, 0, 0, 255)
end
$game_system.bgm_play($data_system.title_bgm)
Audio.me_stop
Audio.bgs_stop
Graphics.transition
loop do
Graphics.update
#淡出背景圖形
if @sprite[0].opacity <= 255
@sprite[0].opacity += 15
end
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
# 釋放圖形
for i in 0..8
@sprite[i].bitmap.dispose
@sprite[i].dispose
end
# @sprite1.bitmap.dispose
# @sprite1.dispose
end
def update
chaochaocommandchaochao
if Input.trigger?(Input::C)
case @command_index
when 0
command_new_game
when 1
command_continue
when 2
command_shutdown
when 3
command_shutdown
end
end
end
def chaochaocommandchaochao
if Input.trigger?(Input::LEFT)
@command_index -= 1
if @command_index < 0
@command_index = 3
end
$game_system.se_play($data_system.cursor_se)
end
if Input.trigger?(Input::RIGHT)
@command_index += 1
if @command_index > 3
@command_index = 0
end
$game_system.se_play($data_system.cursor_se)
end
case @command_index
when 0
if @sprite[1].opacity >= 0
@sprite[1].opacity -= 30
end
if @sprite[2].opacity <= 240
@sprite[2].opacity += 30
end
if @sprite[3].opacity <= 210
@sprite[3].opacity += 30
end
if @sprite[4].opacity >= 0
@sprite[4].opacity -= 30
end
if @sprite[5].opacity <= 210
@sprite[5].opacity += 30
end
if @sprite[6].opacity >= 0
@sprite[6].opacity -= 30
end
if @sprite[7].opacity >= 210
@sprite[7].opacity += 30
end
if @sprite[8].opacity >= 0
@sprite[8].opacity -= 30
end
when 1
if @sprite[1].opacity <= 210
@sprite[1].opacity += 30
end
if @sprite[2].opacity >= 0
@sprite[2].opacity -= 30
end
if @sprite[3].opacity >= 0
@sprite[3].opacity -= 30
end
if @sprite[4].opacity <= 240
@sprite[4].opacity += 30
end
if @sprite[5].opacity <= 210
@sprite[5].opacity += 30
end
if @sprite[6].opacity >= 0
@sprite[6].opacity -= 30
end
if @sprite[7].opacity >= 210
@sprite[7].opacity += 30
end
if @sprite[8].opacity >= 0
@sprite[8].opacity -= 30
end
when 2
if @sprite[1].opacity <= 210
@sprite[1].opacity += 30
end
if @sprite[2].opacity >= 0
@sprite[2].opacity -= 30
end
if @sprite[3].opacity <= 210
@sprite[3].opacity += 30
end
if @sprite[4].opacity >= 0
@sprite[4].opacity -= 30
end
if @sprite[5].opacity >= 0
@sprite[5].opacity -= 30
end
if @sprite[6].opacity <= 240
@sprite[6].opacity += 30
end
if @sprite[7].opacity >= 210
@sprite[7].opacity += 30
end
if @sprite[8].opacity >= 0
@sprite[8].opacity -= 30
end
when 3
if @sprite[1].opacity <= 210
@sprite[1].opacity += 30
end
if @sprite[2].opacity >= 0
@sprite[2].opacity -= 30
end
if @sprite[3].opacity <= 210
@sprite[3].opacity += 30
end
if @sprite[4].opacity >= 0
@sprite[4].opacity -= 30
end
if @sprite[5].opacity >= 210
@sprite[5].opacity -= 30
end
if @sprite[6].opacity >= 0
@sprite[6].opacity -= 30
end
if @sprite[7].opacity <= 210
@sprite[7].opacity += 30
end
if @sprite[8].opacity <= 240
@sprite[8].opacity += 30
end
end
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1