Project1
标题: 有没有会改脚本的大神…… [打印本页]
作者: 万事屋阿银 时间: 2015-4-12 20:26
标题: 有没有会改脚本的大神……
本帖最后由 RyanBern 于 2015-4-12 20:47 编辑
关于这个脚本,一次只能容纳八个音乐啊……谁来改一下,可以换页的……或者可以其它怎么样的
@龙和许也 我只是把字改小了,但是这样光标就会不协调……
#==============================================================================
# ■ Scene_Ryusic v 2.0 正式版
#------------------------------------------------------------------------------
# 流砂的阿瓦隆:雅音奏鳴場景
# 作者 / Yamazaki Ryusa
#==============================================================================
class Scene_Ryusic
# 包含阿瓦隆數據庫
include Avalon_DataBase
# 視覺特效
WEATHER = 4 # 使用自定义效果(0:无,1:雨,2:暴风雨,3:雪,4:自定义)
MAXNUMBER = 32 # 天气图片数量
WEATHER_FILE = "Graphics/Pictures/Notes.png"
BLEND_TYPE = 1 # 合成方式(0:普通,1:加法,2:减法)
WEATHER_X = 0 # X方向每回合减少象素
WEATHER_Y = 5 # Y方向每回合减少象素
WEATHER_OPACITY = 2 #每回合减低透明度
START_OPACITY = 200 #出现时的透明度
RAND_X = 1200 # 随机X范围
RAND_Y = 600 # 随机Y范围
HEIGHT = -600 # 出现时候的屏幕Y
WIDTH = 100 # 出现时候的屏幕X
#--------------------------------------------------------------------------
# ● 主處理
#--------------------------------------------------------------------------
def main
@background = Sprite.new
@background.bitmap = RPG::Cache.picture("Scene_Music_Background.png")
@window_list = Window_RyusicList.new
@window_help = Window_RyusicHelp.new
# ====================================
@ox = 0
@oy = 0
color1 = Color.new(255, 255, 255, 255)
color2 = Color.new(255, 255, 255, 128)
@rain_bitmap = Bitmap.new(7, 56)
for i in 0..6
@rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
end
@storm_bitmap = Bitmap.new(34, 64)
for i in 0..31
@storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
@storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
@storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
end
@snow_bitmap = Bitmap.new(6, 6)
@snow_bitmap.fill_rect(0, 1, 6, 4, color2)
@snow_bitmap.fill_rect(1, 0, 4, 6, color2)
@snow_bitmap.fill_rect(1, 2, 4, 2, color1)
@snow_bitmap.fill_rect(2, 1, 2, 4, color1)
@sprites = []
for i in 1..40
sprite = Sprite.new
case WEATHER
when 1
sprite.bitmap = @rain_bitmap
when 2
sprite.bitmap = @storm_bitmap
when 3
sprite.bitmap = @snow_bitmap
when 4
sprite.bitmap = Bitmap.new(WEATHER_FILE)
end
sprite.z = 9997
sprite.x = -1000
sprite.y = -1000
sprite.visible = (i <= MAXNUMBER)
sprite.blend_type = BLEND_TYPE
sprite.opacity = START_OPACITY
@sprites.push(sprite)
end
# ====================================
Graphics.transition
# 主循環
loop do
Graphics.update
Input.update
update
@window_list.update
@window_help.update
@window_list.rotation
weather_update
# 如果畫面被切換就中斷循環
if $scene != self
break
end
end
Graphics.freeze
@background.dispose
@background.bitmap.dispose
@window_list.dispose
@window_help.dispose
for sprite in @sprites
sprite.dispose
end
@rain_bitmap.dispose
@storm_bitmap.dispose
@snow_bitmap.dispose
# 执行过度
Graphics.transition(40)
# 准备过渡
Graphics.freeze
end
#--------------------------------------------------------------------------
# ● 刷新畫面
#--------------------------------------------------------------------------
def update
if Input.trigger?(Input::B)
$scene = Scene_Map.new
$game_system.se_play($data_system.cancel_se)
end
end
#--------------------------------------------------------------------------
# ● 刷新天气
#--------------------------------------------------------------------------
def weather_update
return if WEATHER == 0
for i in 1..MAXNUMBER
sprite = @sprites[i]
if sprite == nil
break
end
if WEATHER == 1
sprite.x -= 2
sprite.y += 16
sprite.opacity -= 8
end
if WEATHER == 2
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
end
if WEATHER == 3
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 8
end
if WEATHER == 4
sprite.x -= WEATHER_X
sprite.y += WEATHER_Y
sprite.opacity -= WEATHER_OPACITY
end
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 32 or x < -100 or x > 750 or y < -1000 or y > 500
sprite.x = rand(RAND_X) + WIDTH + @ox
sprite.y = rand(RAND_Y) + HEIGHT + @oy
sprite.opacity = START_OPACITY
end
end
end
end
#==============================================================================
# ■ Scene_Ryusic v 2.0 正式版
#------------------------------------------------------------------------------
# 流砂的阿瓦隆:雅音奏鳴場景
# 作者 / Yamazaki Ryusa
#==============================================================================
class Scene_Ryusic
# 包含阿瓦隆數據庫
include Avalon_DataBase
# 視覺特效
WEATHER = 4 # 使用自定义效果(0:无,1:雨,2:暴风雨,3:雪,4:自定义)
MAXNUMBER = 32 # 天气图片数量
WEATHER_FILE = "Graphics/Pictures/Notes.png"
BLEND_TYPE = 1 # 合成方式(0:普通,1:加法,2:减法)
WEATHER_X = 0 # X方向每回合减少象素
WEATHER_Y = 5 # Y方向每回合减少象素
WEATHER_OPACITY = 2 #每回合减低透明度
START_OPACITY = 200 #出现时的透明度
RAND_X = 1200 # 随机X范围
RAND_Y = 600 # 随机Y范围
HEIGHT = -600 # 出现时候的屏幕Y
WIDTH = 100 # 出现时候的屏幕X
#--------------------------------------------------------------------------
# ● 主處理
#--------------------------------------------------------------------------
def main
@background = Sprite.new
@background.bitmap = RPG::Cache.picture("Scene_Music_Background.png")
@window_list = Window_RyusicList.new
@window_help = Window_RyusicHelp.new
# ====================================
@ox = 0
@oy = 0
color1 = Color.new(255, 255, 255, 255)
color2 = Color.new(255, 255, 255, 128)
@rain_bitmap = Bitmap.new(7, 56)
for i in 0..6
@rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
end
@storm_bitmap = Bitmap.new(34, 64)
for i in 0..31
@storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
@storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
@storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
end
@snow_bitmap = Bitmap.new(6, 6)
@snow_bitmap.fill_rect(0, 1, 6, 4, color2)
@snow_bitmap.fill_rect(1, 0, 4, 6, color2)
@snow_bitmap.fill_rect(1, 2, 4, 2, color1)
@snow_bitmap.fill_rect(2, 1, 2, 4, color1)
@sprites = []
for i in 1..40
sprite = Sprite.new
case WEATHER
when 1
sprite.bitmap = @rain_bitmap
when 2
sprite.bitmap = @storm_bitmap
when 3
sprite.bitmap = @snow_bitmap
when 4
sprite.bitmap = Bitmap.new(WEATHER_FILE)
end
sprite.z = 9997
sprite.x = -1000
sprite.y = -1000
sprite.visible = (i <= MAXNUMBER)
sprite.blend_type = BLEND_TYPE
sprite.opacity = START_OPACITY
@sprites.push(sprite)
end
# ====================================
Graphics.transition
# 主循環
loop do
Graphics.update
Input.update
update
@window_list.update
@window_help.update
@window_list.rotation
weather_update
# 如果畫面被切換就中斷循環
if $scene != self
break
end
end
Graphics.freeze
@background.dispose
@background.bitmap.dispose
@window_list.dispose
@window_help.dispose
for sprite in @sprites
sprite.dispose
end
@rain_bitmap.dispose
@storm_bitmap.dispose
@snow_bitmap.dispose
# 执行过度
Graphics.transition(40)
# 准备过渡
Graphics.freeze
end
#--------------------------------------------------------------------------
# ● 刷新畫面
#--------------------------------------------------------------------------
def update
if Input.trigger?(Input::B)
$scene = Scene_Map.new
$game_system.se_play($data_system.cancel_se)
end
end
#--------------------------------------------------------------------------
# ● 刷新天气
#--------------------------------------------------------------------------
def weather_update
return if WEATHER == 0
for i in 1..MAXNUMBER
sprite = @sprites[i]
if sprite == nil
break
end
if WEATHER == 1
sprite.x -= 2
sprite.y += 16
sprite.opacity -= 8
end
if WEATHER == 2
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
end
if WEATHER == 3
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 8
end
if WEATHER == 4
sprite.x -= WEATHER_X
sprite.y += WEATHER_Y
sprite.opacity -= WEATHER_OPACITY
end
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 32 or x < -100 or x > 750 or y < -1000 or y > 500
sprite.x = rand(RAND_X) + WIDTH + @ox
sprite.y = rand(RAND_Y) + HEIGHT + @oy
sprite.opacity = START_OPACITY
end
end
end
end
=======第二个脚本↓============
#------------------------------------------------------------------------------
# 流砂的阿瓦隆:雅音奏鳴曲目列表窗體
# by Yamazaki Ryusa
#==============================================================================
class Window_RyusicList < Window_Base
# 包含阿瓦隆數據庫
include Avalon_DataBase
#--------------------------------------------------------------------------
# ● 初始化對象
#--------------------------------------------------------------------------
def initialize
super(446, 34, 179, 391) # 這項數值從 Photoshop 中獲取
self.back_opacity = 0
self.opacity = 0
self.z = 9988
# 光標
@cursor = Sprite.new
@cursor.bitmap = RPG::Cache.picture("Scene_Music_Cursor.png")
@cursor.blend_type = 2
@cursor.x = 423
@cursor.y = 75
@cursor.z = 9998
@cursor_index = 1
@music_path = MUSIC_PLAYLIST[1][2]
# 光盤底片
@disc_back = Sprite.new
@disc_back.bitmap = RPG::Cache.picture("Music_Disc01.png")
@disc_back.blend_type = 1
@disc_back.opacity = 192
@disc_back.z = 9991
@disc_back.ox = @disc_back.bitmap.width / 2
@disc_back.oy = @disc_back.bitmap.height / 2
@disc_back.x = 0
@disc_back.y = 200
# 光盤旋轉圖
@disc_round = Sprite.new
@disc_round.bitmap = RPG::Cache.picture("Music_Disc02.png")
@disc_round.blend_type = 1
@disc_round.opacity = 16
@disc_round.angle = 0
@disc_round.z = 9992
@disc_round.ox = @disc_round.bitmap.width / 2
@disc_round.oy = @disc_round.bitmap.height / 2
@disc_round.x = 0
@disc_round.y = 200
end
#--------------------------------------------------------------------------
# ● 刷新畫面
#--------------------------------------------------------------------------
def update
super
if Input.trigger?(Input::DOWN)
if @cursor_index < ( MUSIC_PLAYLIST.size )
@cursor_index += 1
@cursor.y += 36
@music_path = MUSIC_PLAYLIST[@cursor_index][2]
$game_system.se_play($data_system.cursor_se)
end
end
if Input.trigger?(Input::UP)
if @cursor_index > 1
@cursor_index -= 1
@cursor.y -= 36
@music_path = MUSIC_PLAYLIST[@cursor_index][2]
$game_system.se_play($data_system.cursor_se)
end
end
# 播放曲目
if Input.trigger?(Input::C)
#p @music_path
Audio.bgm_play("Audio/BGM/" + @music_path, 80, 100)
end
end
#--------------------------------------------------------------------------
# ● 旋轉
#--------------------------------------------------------------------------
def rotation
# 旋轉光碟
@disc_round.angle += 1
end
#--------------------------------------------------------------------------
# ● 釋放光標
#--------------------------------------------------------------------------
def dispose
super
@cursor.bitmap.dispose
@cursor.dispose
@disc_back.bitmap.dispose
@disc_back.dispose
@disc_round.bitmap.dispose
@disc_round.dispose
end
end
#------------------------------------------------------------------------------
# 流砂的阿瓦隆:雅音奏鳴曲目列表窗體
# by Yamazaki Ryusa
#==============================================================================
class Window_RyusicList < Window_Base
# 包含阿瓦隆數據庫
include Avalon_DataBase
#--------------------------------------------------------------------------
# ● 初始化對象
#--------------------------------------------------------------------------
def initialize
super(446, 34, 179, 391) # 這項數值從 Photoshop 中獲取
self.back_opacity = 0
self.opacity = 0
self.z = 9988
# 光標
@cursor = Sprite.new
@cursor.bitmap = RPG::Cache.picture("Scene_Music_Cursor.png")
@cursor.blend_type = 2
@cursor.x = 423
@cursor.y = 75
@cursor.z = 9998
@cursor_index = 1
@music_path = MUSIC_PLAYLIST[1][2]
# 光盤底片
@disc_back = Sprite.new
@disc_back.bitmap = RPG::Cache.picture("Music_Disc01.png")
@disc_back.blend_type = 1
@disc_back.opacity = 192
@disc_back.z = 9991
@disc_back.ox = @disc_back.bitmap.width / 2
@disc_back.oy = @disc_back.bitmap.height / 2
@disc_back.x = 0
@disc_back.y = 200
# 光盤旋轉圖
@disc_round = Sprite.new
@disc_round.bitmap = RPG::Cache.picture("Music_Disc02.png")
@disc_round.blend_type = 1
@disc_round.opacity = 16
@disc_round.angle = 0
@disc_round.z = 9992
@disc_round.ox = @disc_round.bitmap.width / 2
@disc_round.oy = @disc_round.bitmap.height / 2
@disc_round.x = 0
@disc_round.y = 200
end
#--------------------------------------------------------------------------
# ● 刷新畫面
#--------------------------------------------------------------------------
def update
super
if Input.trigger?(Input::DOWN)
if @cursor_index < ( MUSIC_PLAYLIST.size )
@cursor_index += 1
@cursor.y += 36
@music_path = MUSIC_PLAYLIST[@cursor_index][2]
$game_system.se_play($data_system.cursor_se)
end
end
if Input.trigger?(Input::UP)
if @cursor_index > 1
@cursor_index -= 1
@cursor.y -= 36
@music_path = MUSIC_PLAYLIST[@cursor_index][2]
$game_system.se_play($data_system.cursor_se)
end
end
# 播放曲目
if Input.trigger?(Input::C)
#p @music_path
Audio.bgm_play("Audio/BGM/" + @music_path, 80, 100)
end
end
#--------------------------------------------------------------------------
# ● 旋轉
#--------------------------------------------------------------------------
def rotation
# 旋轉光碟
@disc_round.angle += 1
end
#--------------------------------------------------------------------------
# ● 釋放光標
#--------------------------------------------------------------------------
def dispose
super
@cursor.bitmap.dispose
@cursor.dispose
@disc_back.bitmap.dispose
@disc_back.dispose
@disc_round.bitmap.dispose
@disc_round.dispose
end
end
==========第三个脚本↓=============
#==============================================================================
# ■ Window_RyusicHelp
#------------------------------------------------------------------------------
# 流砂的阿瓦隆:雅音奏鳴曲目信息介紹
# by Yamazaki Ryusa
#==============================================================================
class Window_RyusicHelp < Window_Base
# 包含阿瓦隆數據庫
include Avalon_DataBase
#--------------------------------------------------------------------------
# ● 初始化對象
#--------------------------------------------------------------------------
def initialize
super(4, 60, 425, 170)
self.back_opacity = 0
self.opacity = 0
self.z = 9999
@cursor_index = 1
@introduction = Sprite.new
@introduction.bitmap = RPG::Cache.picture("No_Detail.png")
end
#--------------------------------------------------------------------------
# ● 刷新光標邏輯位置
#--------------------------------------------------------------------------
def update
if Input.trigger?(Input::DOWN)
if @cursor_index < ( MUSIC_PLAYLIST.size )
@cursor_index += 1
end
end
if Input.trigger?(Input::UP)
if @cursor_index > 1
@cursor_index -= 1
#p @current_index
end
end
if Input.trigger?(Input::C)
change_picture
end
end
#--------------------------------------------------------------------------
# ● 刷新文字和介紹
#--------------------------------------------------------------------------
def change_picture
@introduction.bitmap = RPG::Cache.picture(MUSIC_PLAYLIST[@cursor_index][4])
end
#--------------------------------------------------------------------------
# ● 釋放介紹圖片
#--------------------------------------------------------------------------
def dispose
@introduction.bitmap.dispose
@introduction.dispose
end
end
#==============================================================================
# ■ Window_RyusicHelp
#------------------------------------------------------------------------------
# 流砂的阿瓦隆:雅音奏鳴曲目信息介紹
# by Yamazaki Ryusa
#==============================================================================
class Window_RyusicHelp < Window_Base
# 包含阿瓦隆數據庫
include Avalon_DataBase
#--------------------------------------------------------------------------
# ● 初始化對象
#--------------------------------------------------------------------------
def initialize
super(4, 60, 425, 170)
self.back_opacity = 0
self.opacity = 0
self.z = 9999
@cursor_index = 1
@introduction = Sprite.new
@introduction.bitmap = RPG::Cache.picture("No_Detail.png")
end
#--------------------------------------------------------------------------
# ● 刷新光標邏輯位置
#--------------------------------------------------------------------------
def update
if Input.trigger?(Input::DOWN)
if @cursor_index < ( MUSIC_PLAYLIST.size )
@cursor_index += 1
end
end
if Input.trigger?(Input::UP)
if @cursor_index > 1
@cursor_index -= 1
#p @current_index
end
end
if Input.trigger?(Input::C)
change_picture
end
end
#--------------------------------------------------------------------------
# ● 刷新文字和介紹
#--------------------------------------------------------------------------
def change_picture
@introduction.bitmap = RPG::Cache.picture(MUSIC_PLAYLIST[@cursor_index][4])
end
#--------------------------------------------------------------------------
# ● 釋放介紹圖片
#--------------------------------------------------------------------------
def dispose
@introduction.bitmap.dispose
@introduction.dispose
end
end
===========最后一个脚本↓==============
#==============================================================================
# ■ Avalon_DataBase
#------------------------------------------------------------------------------
# 阿瓦隆數據庫
# by Yamazaki Ryusa
#==============================================================================
module Avalon_DataBase
# 音樂播放列表·哈希表
MUSIC_PLAYLIST = {
# 標題,作者,文件路徑,長度,介紹圖片路徑
# 此版本已將作者、標題、長度和介紹圖片和為一體,指定文件路徑和『介紹圖片』路徑即可
1 => ["六十年目的东方裁判","东方Project", "六十年的东方裁判.mp3", "02:38", "Music Room/Playlist01.png"],
2 => ["亡女七重奏","东方project","亡き皇王女の為のセプテット.wma","",""],
3 => ["","","","",""],
4 => ["蓬莱传说","东方project","蓬莱传说.mp3","","Music Room/Playlist04.png"],
5 => ["","","","",""],
6 => ["","","","",""],
7 => ["","","","",""],
8 => ["","","","",""],
}
end
#==============================================================================
# ■ Avalon_DataBase
#------------------------------------------------------------------------------
# 阿瓦隆數據庫
# by Yamazaki Ryusa
#==============================================================================
module Avalon_DataBase
# 音樂播放列表·哈希表
MUSIC_PLAYLIST = {
# 標題,作者,文件路徑,長度,介紹圖片路徑
# 此版本已將作者、標題、長度和介紹圖片和為一體,指定文件路徑和『介紹圖片』路徑即可
1 => ["六十年目的东方裁判","东方Project", "六十年的东方裁判.mp3", "02:38", "Music Room/Playlist01.png"],
2 => ["亡女七重奏","东方project","亡き皇王女の為のセプテット.wma","",""],
3 => ["","","","",""],
4 => ["蓬莱传说","东方project","蓬莱传说.mp3","","Music Room/Playlist04.png"],
5 => ["","","","",""],
6 => ["","","","",""],
7 => ["","","","",""],
8 => ["","","","",""],
}
end
==============這個好像沒太大關係==============
作者: 芯☆淡茹水 时间: 2015-4-13 00:06
可以弄左右键翻页嘛,最下面再显示个 当前页数/总页数 。
没有测试工程不好判断位置。
作者: wolves 时间: 2015-4-14 12:08
有范例么,我直接给你把范例改了吧
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |