| 赞 | 17 |
| VIP | |
| 好人卡 | |
| 积分 | 13 |
| 经验 | |
| 最后登录 | 2019-6-27 |
| 在线时间 | 354 小时 |
- 梦石
- 0
- 星屑
- 1328
- 在线时间
- 354 小时
- 注册时间
- 2009-9-14
- 回帖
- 211
|
悬赏50星屑已解决
如何能让这个脚本在战斗中也工作??谢谢
[pre lang="ruby"]#==============================================================================
# ■Window_Music by nanikoyizi
#------------------------------------------------------------------------------
# 在地图上显示当前演奏的音乐的窗口脚本
# 这个是为了给注重音乐的游戏使用的(σ ̄▽ ̄)σ
#==============================================================================
class Window_Music < Window_Base
#--------------------------------------------------------------------------
# ●初始化
#--------------------------------------------------------------------------
def initialize
super(0,0,640,96)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.size = 22 #这里可以调文字大小
@OP = 0
@OP2 = 0
@r = 100 #字幕持续时间
@Turn = false
$MusicName = "摘自网络"
$Artist = "无"
case $game_system.playing_bgm.name
when "山路"
$MusicName = "平均律第一册 BWV846前奏曲"
$Artist = "巴赫"
when "起始城教堂"
$MusicName = "BWV565 赋格"
$Artist = "巴赫"
end
self.opacity = 0
end
#--------------------------------------------------------------------------
# ●更新
#--------------------------------------------------------------------------
def update
if @OP > 0 or @Turn == false
self.contents.clear
if @Turn == false
@OP += 4 #字幕出现渐变速度
@OP2 += 160/51 #((4*200/5)/(255/5))
else
@OP -= 4 #字幕消失渐变速度
@OP2 -= 160/51 #((4*200/5)/(255/5))
end
self.contents.font.color = Color.new(0, 0, 0, @OP2)
self.contents.font.name = "Arial Black"
self.contents.draw_text(2, 2, 10, 32, "♪ ")
self.contents.font.name = "黑体"
self.contents.draw_text(12, 4, 640, 32, $MusicName)
self.contents.font.color = Color.new(255, 255, 255, @OP)
self.contents.font.name = "Arial Black"
self.contents.draw_text(0, 0, 10, 32, "♪ ")
self.contents.font.name = "黑体"
self.contents.draw_text(10, 2, 640, 32, $MusicName)
if $Artist != nil
self.contents.font.color = Color.new(0, 0, 0, @OP2)
self.contents.draw_text(2, 34, 640, 32, "作者:" + $Artist)
self.contents.font.color = Color.new(255, 255, 255, @OP)
self.contents.draw_text(0, 32, 640, 32, "作者:" + $Artist)
end
if @OP >= 255
@r -= 1
if @r == 0
@Turn = true
end
end
end
end
end
[/pre] |
最佳答案
查看完整内容
这个是一个窗口,要战斗中显示那就直接到战斗场景里添加这个窗口实例即可
到scene_battle1的main里,添加
aaa = Window_Music.new
然后找到中间标注 #循环 的地方,在 update 下面添上 aaa.update
最后在下面写着#释放 的下面,添上 aaa.dispose
搞定收工
需要调整位置,就在aaa = XXX下面用 aaa.x = 数字, aaa.y = 数字, aaa.z = 数字(这个是优先度) 来调整就好了。
...
|