加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 kuerlulu 于 2013-12-10 11:55 编辑
@天地有正气
慢慢来啊。。【我也是新人的说【快说你们不认识我
#功能:游戏任何时候过渡一张图片
初代版(和正气君的第一个功能是一样的),但是由于使用了RPG::Cache.title(),所以只能用Titles文件夹内的文件啦..
def logo(title="001-Title01",speed=5) logo = Sprite.new;logo.opacity = 0;logo.bitmap = RPG::Cache.title(title) n = 255/speed + 1 n.times{ logo.opacity += speed Graphics.update } (n/2).times{Graphics.update} n.times{ logo.opacity -= speed Graphics.update } logo.bitmap.dispose logo.dispose end logo()
def logo(title="001-Title01",speed=5)
logo = Sprite.new;logo.opacity = 0;logo.bitmap = RPG::Cache.title(title)
n = 255/speed + 1
n.times{
logo.opacity += speed
Graphics.update
}
(n/2).times{Graphics.update}
n.times{
logo.opacity -= speed
Graphics.update
}
logo.bitmap.dispose
logo.dispose
end
logo()
说更新我就来更新了【中间间隔才半小时喂
def logo(titlearray=["001-Title01"],speed=5) logo = [] for i in 0..(titlearray.size-1) logo[i] = Sprite.new logo[i].opacity = 0 logo[i].bitmap = RPG::Cache.title(titlearray[i]) end n = 255/speed + 1 for i in 0..(titlearray.size-1) n.times{ logo[i].opacity += speed Graphics.update } (n/2).times{Graphics.update} end Graphics.freeze for i in 0..(titlearray.size-1) logo[i].bitmap.dispose logo[i].dispose end Graphics.transition end logo()
def logo(titlearray=["001-Title01"],speed=5)
logo = []
for i in 0..(titlearray.size-1)
logo[i] = Sprite.new
logo[i].opacity = 0
logo[i].bitmap = RPG::Cache.title(titlearray[i])
end
n = 255/speed + 1
for i in 0..(titlearray.size-1)
n.times{
logo[i].opacity += speed
Graphics.update
}
(n/2).times{Graphics.update}
end
Graphics.freeze
for i in 0..(titlearray.size-1)
logo[i].bitmap.dispose
logo[i].dispose
end
Graphics.transition
end
logo()
这里需要注意的是第一个参数变成了数组,也就是和选择菜单的方法差不多的样子。
然后可以这样写: logo(["001-Title01","jfkdjlfjd","fdhajkfhjkdsa"],5)就是将Titles文件夹内"001-Title01","jfkdjlfjd","fdhajkfhjkdsa"这三个文件进行速度5的播放。
接下来主体部分就没什么好更改的了。。
啊..看了恋挂机前辈的脚本之后。。加个each就变成了这样:
def logo(titlearray=["001-Title01","shot1","shot2"],speed=5) logo = [] for i in 0..(titlearray.size-1) logo[i] = Sprite.new logo[i].opacity = 0 logo[i].bitmap = RPG::Cache.title(titlearray[i]) end n = 255/speed + 1 logo.each{|i| n.times{i.opacity += speed;Graphics.update} (n/2).times{Graphics.update} } Graphics.freeze logo.each{|i|i.bitmap.dispose;i.dispose} Graphics.transition end logo()
def logo(titlearray=["001-Title01","shot1","shot2"],speed=5)
logo = []
for i in 0..(titlearray.size-1)
logo[i] = Sprite.new
logo[i].opacity = 0
logo[i].bitmap = RPG::Cache.title(titlearray[i])
end
n = 255/speed + 1
logo.each{|i|
n.times{i.opacity += speed;Graphics.update}
(n/2).times{Graphics.update}
}
Graphics.freeze
logo.each{|i|i.bitmap.dispose;i.dispose}
Graphics.transition
end
logo()
RE:晴兰 啊..我也不清楚可不可以用相对路径的说、、所以不要在意细节= = |