赞 | 27 |
VIP | 400 |
好人卡 | 13 |
积分 | 17 |
经验 | 69730 |
最后登录 | 2023-6-12 |
在线时间 | 3038 小时 |
Lv3.寻梦者 (暗夜天使) 精灵族の天使
- 梦石
- 0
- 星屑
- 1697
- 在线时间
- 3038 小时
- 注册时间
- 2007-3-16
- 帖子
- 33731
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 精灵使者 于 2013-9-8 00:30 编辑
作用:在右下角显示地图名和地图坐标。
XPver:适用于XP版本
- #==========================================================================
- # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
- #==========================================================================
- module MAP_XY
- WINDOW_XY = 1 # XY坐标窗口开关
- MAPNAME_COLOR =
- Color.new(255, 255, 255) # 地图名颜色,如果是其他颜色请指定
- XYNAME_COLOR =
- Color.new(192, 224, 255) # XY名字的颜色,如果是其他颜色请指定
- XYNUMBER_COLOR =
- Color.new(255, 255, 255) # XY数字的颜色,如果是其他颜色请指定
- XY_OPACITY = 0 # XY窗口的透明度,默认完全透明
- XY_B_OPACITY = 0 # XY窗口背景的透明度,默认完全透明
- XY_C_OPACITY = 255 # XY窗口内容的透明度,默认完全不透明
- XYBACK_PNG = "" # XY背景图片文件名(注:背景图片会遮挡小地图)
- XYBACK_OPATITY = 192 # XY背景透明度(建议透明,否则会完全盖住)
- XY_WORD_X = "X:" # 表示X坐标的用语
- XY_WORD_Y = "Y:" # 表示Y坐标的用语
- end
- #==============================================================================
- # ■ Window_XY
- #------------------------------------------------------------------------------
- # 显示坐标的窗口。
- #==============================================================================
- class Window_xy < Window_Base#注意前面那个window_xy是文件名
- #--------------------------------------------------------------------------
- # ● 初始化窗口
- #--------------------------------------------------------------------------
- def initialize
- $mapnames = load_data("Data/MapInfos.rxdata") #读取地图名文件
- super(0, 0, 224, 96)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
- self.contents = Bitmap.new(width - 32, height - 32)
- self.back_opacity = MAP_XY::XY_B_OPACITY # 这个是背景透明
- self.opacity = MAP_XY::XY_OPACITY # 这个是边框和背景都透明
- self.contents.font.bold = true
- self.contents_opacity = MAP_XY::XY_C_OPACITY # 这个是内容透明
- self.visible = false
- @x = $game_player.x
- @y = $game_player.y
- @id = $game_map.map_id
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if $game_switches[MAP_XY::WINDOW_XY] #确定开关是否打开,可以自己改变开关
- @x = $game_player.x #获取角色X坐标
- @y = $game_player.y #获取角色Y坐标
- @id = $game_map.map_id #获取地图编号
- self.contents.clear #清除以前的东西
- map_name = $mapnames[@id].name #获得地图名
- self.contents.font.color = MAP_XY::MAPNAME_COLOR#颜色,这里是白色~
- self.contents.draw_text(0, 0,175, 32, map_name,1)
- self.contents.font.color = MAP_XY::XYNAME_COLOR #颜色,暗蓝色
- self.contents.draw_text(0, 32, 175, 32, MAP_XY::XY_WORD_X)#显示X这个字的位置,引号里面的内容随便改,比如"X坐标地址"
- self.contents.font.color = MAP_XY::XYNUMBER_COLOR#颜色,这里是白色~
- self.contents.draw_text(0, 32, 80, 32, @x.to_s,2)
- self.contents.font.color = MAP_XY::XYNAME_COLOR #上面那个是X坐标的变量,可以自己更改变量名~
- self.contents.draw_text(95, 32, 175, 32, MAP_XY::XY_WORD_Y)#显示Y这个字~
- self.contents.font.color = MAP_XY::XYNUMBER_COLOR
- self.contents.draw_text(0, 32, 175, 32, @y.to_s,2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 判断文字刷新。节约内存用
- #--------------------------------------------------------------------------
- def judge
- return true if @x != $game_player.x
- return true if @y != $game_player.y
- return true if @id != $game_map.map_id
- return false
- end
- end
- ###########################################################################
- # 下面的东西不需要掌握~ #
- ###########################################################################
- class Scene_Map
- alias xy_66rpg_main main
- def main
- @xy_window = Window_xy.new
- @xy_window.x = 640 - 16 - @xy_window.width
- @xy_window.y = 480 - 16 - @xy_window.height
- @xy_window.z = 2000
- @xy_window.opacity = MAP_XY::XY_OPACITY
- @back = Sprite.new
- unless MAP_XY::XYBACK_PNG.empty?
- @back.bitmap = Bitmap.new("Graphics/Pictures/"+MAP_XY::XYBACK_PNG)
- @back.x = 640 - 16 - @back.bitmap.width
- @back.y = 480 - 16 - @back.bitmap.height
- @back.z = 1250
- end
- @back.visible = @xy_window.visible
- @back.opacity = MAP_XY::XYBACK_OPATITY
- xy_66rpg_main
- @xy_window.dispose
- @back.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- alias xy_66rpg_update update
- def update
- xy_66rpg_update
- if $game_switches[MAP_XY::WINDOW_XY]
- @xy_window.visible = true
- @back.visible = @xy_window.visible
- @xy_window.refresh if @xy_window.judge
- else
- @xy_window.visible = false
- @back.visible = @xy_window.visible
- end
- end
- end
- #==========================================================================
- # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
- #==========================================================================
复制代码 VX ver:适用于VX版本
- #==========================================================================
- # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
- #==========================================================================
- module MAP_XY
- WINDOW_XY = 1 # XY坐标窗口开关
- MAPNAME_COLOR =
- Color.new(255, 255, 255) # 地图名颜色,如果是其他颜色请指定
- XYNAME_COLOR =
- Color.new(192, 224, 255) # XY名字的颜色,如果是其他颜色请指定
- XYNUMBER_COLOR =
- Color.new(255, 255, 255) # XY数字的颜色,如果是其他颜色请指定
- XY_OPACITY = 0 # XY窗口的透明度,默认完全不透明
- XY_B_OPACITY = 0 # XY窗口背景的透明度,默认完全透明
- XY_C_OPACITY = 255 # XY窗口内容的透明度,默认完全不透明
- XYBACK_PNG = "" # XY背景图片文件名(注:背景图片会遮挡小地图)
- XYBACK_OPATITY = 0 # XY背景透明度(建议透明,否则会完全盖住)
- XY_WORD_X = "X:" # 表示X坐标的用语
- XY_WORD_Y = "Y:" # 表示Y坐标的用语
- end
- #==============================================================================
- # ■ Window_XY
- #------------------------------------------------------------------------------
- # 显示坐标的窗口。
- #==============================================================================
- class Window_xy < Window_Base#注意前面那个window_xy是文件名
- #--------------------------------------------------------------------------
- # ● 初始化窗口
- #--------------------------------------------------------------------------
- def initialize
- $mapnames = load_data("Data/MapInfos.rvdata") #读取地图名文件
- super(0, 0, 224, 96)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
- self.contents = Bitmap.new(width - 32, height - 32)
- self.back_opacity = MAP_XY::XY_B_OPACITY # 这个是背景透明
- self.opacity = MAP_XY::XY_OPACITY # 这个是边框和背景都透明
- self.contents.font.bold = true
- self.contents_opacity = MAP_XY::XY_C_OPACITY # 这个是内容透明
- self.visible = false
- @x = $game_player.x #获取角色X坐标
- @y = $game_player.y #获取角色Y坐标
- @id = $game_map.map_id #获取地图编号
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if $game_switches[MAP_XY::WINDOW_XY] #确定开关是否打开,可以自己改变开关
- @x = $game_player.x #获取角色X坐标
- @y = $game_player.y #获取角色Y坐标
- @id = $game_map.map_id #获取地图编号
- self.contents.clear #清除以前的东西
- map_name = $mapnames[@id].name #获得地图名
- self.contents.font.color = MAP_XY::MAPNAME_COLOR#颜色,这里是白色~
- self.contents.draw_text(0, 0,175, 32, map_name,1)
- self.contents.font.color = MAP_XY::XYNAME_COLOR #颜色,暗蓝色
- self.contents.draw_text(0, 32, 175, 32, MAP_XY::XY_WORD_X)#显示X这个字的位置,引号里面的内容随便改,比如"X坐标地址"
- self.contents.font.color = MAP_XY::XYNUMBER_COLOR#颜色,这里是白色~
- self.contents.draw_text(0, 32, 80, 32, @x.to_s,2)
- self.contents.font.color = MAP_XY::XYNAME_COLOR #上面那个是X坐标的变量,可以自己更改变量名~
- self.contents.draw_text(95, 32, 175, 32, MAP_XY::XY_WORD_Y)#显示Y这个字~
- self.contents.font.color = MAP_XY::XYNUMBER_COLOR
- self.contents.draw_text(0, 32, 175, 32, @y.to_s,2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 判断文字刷新。节约内存用
- #--------------------------------------------------------------------------
- def judge
- return true if @x != $game_player.x
- return true if @y != $game_player.y
- return true if @id != $game_map.map_id
- return false
- end
- end
- ###########################################################################
- # 下面的东西不需要掌握~ #
- ###########################################################################
- class Scene_Map
- alias xy_66rpg_start start
- def start
- xy_66rpg_start
- @xy_window = Window_xy.new
- @xy_window.x = 544 - 16 - @xy_window.width
- @xy_window.y = 416 - 16 - @xy_window.height
- @xy_window.z = 2000
- @xy_window.opacity = MAP_XY::XY_OPACITY
- @back = Sprite.new
- unless MAP_XY::XYBACK_PNG.empty?
- @back.bitmap = Bitmap.new("Graphics/Pictures/"+MAP_XY::XYBACK_PNG)
- @back.x = 544 - 16 - @back.bitmap.width
- @back.y = 416 - 16 - @back.bitmap.height
- @back.z = 1250
- end
- @back.visible = @xy_window.visible
- @back.opacity = MAP_XY::XYBACK_OPATITY
- end
- alias xy_66rpg_terminate terminate
- def terminate
- xy_66rpg_terminate
- @xy_window.dispose
- @back.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- alias xy_66rpg_update update
- def update
- xy_66rpg_update
- if $game_switches[MAP_XY::WINDOW_XY]
- @xy_window.visible = true
- @back.visible = @xy_window.visible
- if @xy_window.judge
- @xy_window.refresh
- end
- @xy_window.update
- else
- @xy_window.visible = false
- @back.visible = @xy_window.visible
- end
- end
- end
- #==========================================================================
- # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
- #==========================================================================
复制代码 Ace ver:适用于ACE版本
- #==========================================================================
- # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
- #==========================================================================
- module MAP_XY
- WINDOW_XY = 1 # XY坐标窗口开关
- MAPNAME_COLOR =
- Color.new(255, 255, 255) # 地图名颜色,如果是其他颜色请指定
- XYNAME_COLOR =
- Color.new(192, 224, 255) # XY名字的颜色,如果是其他颜色请指定
- XYNUMBER_COLOR =
- Color.new(255, 255, 255) # XY数字的颜色,如果是其他颜色请指定
- XY_OPACITY = 0 # XY窗口的透明度,默认完全不透明
- XY_B_OPACITY = 0 # XY窗口背景的透明度,默认完全透明
- XY_C_OPACITY = 255 # XY窗口内容的透明度,默认完全不透明
- XYBACK_PNG = "" # XY背景图片文件名(注:背景图片会遮挡小地图)
- XYBACK_OPATITY = 0 # XY背景透明度(建议透明,否则会完全盖住)
- XY_WORD_X = "X:" # 表示X坐标的用语
- XY_WORD_Y = "Y:" # 表示Y坐标的用语
- end
- #==============================================================================
- # ■ Window_XY
- #------------------------------------------------------------------------------
- # 显示坐标的窗口。
- #==============================================================================
- class Window_xy < Window_Base#注意前面那个window_xy是文件名
- #--------------------------------------------------------------------------
- # ● 初始化窗口
- #--------------------------------------------------------------------------
- def initialize
- $mapnames = load_data("Data/MapInfos.rvdata2") #读取地图名文件
- super(0, 0, 224, 96)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
- self.contents = Bitmap.new(width - 32, height - 32)
- self.back_opacity = MAP_XY::XY_B_OPACITY # 这个是背景透明
- self.opacity = MAP_XY::XY_OPACITY # 这个是边框和背景都透明
- self.contents.font.bold = true
- self.contents_opacity = MAP_XY::XY_C_OPACITY # 这个是内容透明
- self.visible = false
- @x = $game_player.x #获取角色X坐标
- @y = $game_player.y #获取角色Y坐标
- @id = $game_map.map_id #获取地图编号
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- if $game_switches[MAP_XY::WINDOW_XY] #确定开关是否打开,可以自己改变开关
- @x = $game_player.x #获取角色X坐标
- @y = $game_player.y #获取角色Y坐标
- @id = $game_map.map_id #获取地图编号
- self.contents.clear #清除以前的东西
- map_name = $mapnames[@id].name #获得地图名
- self.contents.font.color = MAP_XY::MAPNAME_COLOR#颜色,这里是白色~
- name = map_name
- cx = name.length * 7
- ye = 130 - cx
- if ye < 0
- ye = 0
- elsif ye > self.width - 5
- ye = self.width - 5
- end
- self.contents.draw_text(ye, 0,cx, 32, map_name,0)
- self.contents.font.color = MAP_XY::XYNAME_COLOR #颜色,暗蓝色
- self.contents.draw_text(0, 32, 175, 32, MAP_XY::XY_WORD_X)#显示X这个字的位置,引号里面的内容随便改,比如"X坐标地址"
- self.contents.font.color = MAP_XY::XYNUMBER_COLOR#颜色,这里是白色~
- self.contents.draw_text(0, 32, 80, 32, @x.to_s,2)
- self.contents.font.color = MAP_XY::XYNAME_COLOR #上面那个是X坐标的变量,可以自己更改变量名~
- self.contents.draw_text(95, 32, 175, 32, MAP_XY::XY_WORD_Y)#显示Y这个字~
- self.contents.font.color = MAP_XY::XYNUMBER_COLOR
- self.contents.draw_text(0, 32, 175, 32, @y.to_s,2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 判断文字刷新。节约内存用
- #--------------------------------------------------------------------------def judge
- def judge
- return true if @x != $game_player.x
- return true if @y != $game_player.y
- return true if @id != $game_map.map_id
- return false
- end
- end
- ###########################################################################
- # 下面的东西不需要掌握~ #
- ###########################################################################
- class Scene_Map
- alias xy_66rpg_start start
- def start
- xy_66rpg_start
- @xy_window = Window_xy.new
- @xy_window.x = 544 - 16 -@xy_window.width
- @xy_window.y = 416 - 16 -@xy_window.height
- @xy_window.z = 2000
- @xy_window.opacity = MAP_XY::XY_OPACITY
- @back = Sprite.new
- unless MAP_XY::XYBACK_PNG.empty?
- @back.bitmap = Bitmap.new("Graphics/Pictures/"+MAP_XY::XYBACK_PNG)
- @back.x = 544 - 16 - @back.bitmap.width
- @back.y = 416 - 16 - @back.bitmap.height
- @back.z = 1250
- end
- @back.visible = @xy_window.visible
- @back.opacity = MAP_XY::XYBACK_OPATITY
- end
- alias xy_66rpg_terminate terminate
- def terminate
- xy_66rpg_terminate
- @xy_window.dispose
- @back.dispose
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- alias xy_66rpg_update update
- def update
- xy_66rpg_update
- if $game_switches[MAP_XY::WINDOW_XY]
- @xy_window.visible = true
- @back.visible = @xy_window.visible
- if @xy_window.judge
- @xy_window.refresh
- end
- @xy_window.update
- else
- @xy_window.visible = false
- @back.visible = @xy_window.visible
- end
- end
- end
- #==========================================================================
- # 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
- #==========================================================================
复制代码 更新版本:修正了VX和ACE的背景图的坐标错误,更新了前景窗口的坐标
效果图:
|
评分
-
查看全部评分
|