Project1
标题: logo (其实是最简单的显示图片) [打印本页]
作者: kuerlulu 时间: 2013-12-9 12:17
标题: logo (其实是最简单的显示图片)
本帖最后由 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:晴兰 啊..我也不清楚可不可以用相对路径的说、、所以不要在意细节= =
作者: 紫英晓狼1130 时间: 2013-12-9 21:54
怎么这里都讨论起显示LOGO的问题了?恋挂机的脚本在我看来是最简单的
作者: myownroc 时间: 2013-12-9 22:03
感觉这是Ruby教程里的数组方面的教程……
作者: 无脑之人 时间: 2013-12-10 21:40
1.路径什么的判定一下啦- -
2.可以要求提供一个块来控制移动路径和图形效果
3.这个东西没有设计成并行的……显示的时候其他的都卡了……而且每帧运行的除了Graphics.update之外还可能有Input.update Kboard.update Mouse.update(不加Mouse.update会导致鼠标卡住)……所以还是建议提供一个块来控制update的部分
「什么?块太多?当成对象用参数传进来不就行了233」
欢迎光临 Project1 (https://rpg.blue/) |
Powered by Discuz! X3.1 |