Project1
标题:
限制地图大小
[打印本页]
作者:
zhangchi5
时间:
2012-3-25 17:44
标题:
限制地图大小
http://rpg.blue/forum.php?mod=vi ... p;page=1&extra=
“如题,整个游戏窗口大小是1024*768,但我想把map限制在800*640,剩下的地方放地图啊、人物头像啊、按钮什么的,咋整?”
哥做的:
class Spriteset_Map
#--------------------------------------------------------------------------
# ● 生成显示端口
#--------------------------------------------------------------------------
def create_viewports
height=416 #宽度
width=544 #高度
@viewport1 = Viewport.new((Graphics.width-width)/2,(Graphics.height-height/2),width,height)
@viewport2 = Viewport.new((Graphics.width-width)/2,(Graphics.height-height/2),width,height)
@viewport3 = Viewport.new((Graphics.width-width)/2,(Graphics.height-height/2),width,height)
@viewport2.z = 50
@viewport3.z = 100
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1