Project1

标题: 限制地图大小 [打印本页]

作者: zhangchi5    时间: 2012-3-25 17:44
标题: 限制地图大小

http://rpg.blue/forum.php?mod=vi ... p;page=1&extra=
“如题,整个游戏窗口大小是1024*768,但我想把map限制在800*640,剩下的地方放地图啊、人物头像啊、按钮什么的,咋整?”

哥做的:
  1. class Spriteset_Map
  2.   #--------------------------------------------------------------------------
  3.   # ● 生成显示端口
  4.   #--------------------------------------------------------------------------
  5.   def create_viewports
  6.    
  7.     height=416 #宽度
  8.     width=544 #高度
  9.     @viewport1 = Viewport.new((Graphics.width-width)/2,(Graphics.height-height/2),width,height)
  10.     @viewport2 = Viewport.new((Graphics.width-width)/2,(Graphics.height-height/2),width,height)
  11.     @viewport3 = Viewport.new((Graphics.width-width)/2,(Graphics.height-height/2),width,height)
  12.     @viewport2.z = 50
  13.     @viewport3.z = 100
  14.   end
  15. end
复制代码





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1