Project1
标题:
这么才能把坐标框去掉
[打印本页]
作者:
yuyinwww
时间:
2011-1-21 15:57
标题:
这么才能把坐标框去掉
本帖最后由 fux2 于 2011-1-21 16:00 编辑
class Window_XY < Window_Base
#=========================================================
# 该系统还可以设置为显示变量……具体请自己代入试试...
#=========================================================
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
super(0, 0, 200, 100)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if $game_switches[2200]
self.visible = true
else
self.visible = false
end
self.contents.clear
#===========是否显示*32的坐标系。=========
if $game_switches[23]
x = $game_player.x * 32
y = $game_player.y * 32
else
x = $game_player.x
y = $game_player.y
end
#===============这个应该自己看得懂..======================
self.contents.draw_text(0, 0, 64, 32, "X")
self.contents.draw_text(80, 0, 64, 32, x.to_s)
self.contents.draw_text(0, 32, 64, 32, "Y")
self.contents.draw_text(80, 32, 64, 32, y.to_s)
# 代入之前设置的变量。表示如果开启了23号开关,将显示640*480的坐标系。
# 没错,看显示就知道了,每个格子实际上是32*32像素的小方块..
end
end
#========================================================
# 在地图上显示该窗口...使用dispose和update进行刷新处理..
#========================================================
class Scene_Map
alias xy1_main main
def main
@xywindow=Window_XY.new
xy1_main
@xywindow.dispose
end
alias xy1_update update
def update
@xywindow.refresh
xy1_update
end
end
复制代码
作者:
忧雪の伤
时间:
2011-1-21 16:18
class Window_XY < Window_Base
#=========================================================
# 该系统还可以设置为显示变量……具体请自己代入试试...
#=========================================================
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
super(0, 0, 200, 100)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if $game_switches[2200]
self.visible = true
else
self.visible = false
end
self.contents.clear
#===========是否显示*32的坐标系。=========
if $game_switches[23]
x = $game_player.x * 32
y = $game_player.y * 32
else
x = $game_player.x
y = $game_player.y
end
#===============这个应该自己看得懂..======================
self.contents.draw_text(0, 0, 64, 32, "X")
self.contents.draw_text(80, 0, 64, 32, x.to_s)
self.contents.draw_text(0, 32, 64, 32, "Y")
self.contents.draw_text(80, 32, 64, 32, y.to_s)
# 代入之前设置的变量。表示如果开启了23号开关,将显示640*480的坐标系。
# 没错,看显示就知道了,每个格子实际上是32*32像素的小方块..
end
end
#========================================================
# 在地图上显示该窗口...使用dispose和update进行刷新处理..
#========================================================
class Scene_Map
alias xy1_main main
def main
@xywindow=Window_XY.new
xy1_main
@xywindow.dispose
end
alias xy1_update update
def update
@xywindow.refresh
xy1_update
end
end
复制代码
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1