Project1
标题:
请教远景地图事件
[打印本页]
作者:
独孤剑
时间:
2008-12-13 03:02
标题:
请教远景地图事件
用远景地图后,编辑事件的时候是看不见地图的,那怎么编写事件啊??{/jy} [LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
a5396982
时间:
2008-12-13 20:15
#================================================
# ■ Window_Pos
#================================================
class Window_Pos < Window_Base
#------------------------------------------------
# ● 初始化
#------------------------------------------------
def initialize
super(0, 0, 122, 52)
self.z = 151
self.contents.font.size = 20
refresh
end
#------------------------------------------------
# ● 刷新
#------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
@x,@y = $game_player.x,$game_player.y
self.contents.draw_text(0, 0, 90, 20, "(#{@x},#{@y})", 1)
end
#------------------------------------------------
# ● 更新
#------------------------------------------------
def update
return if $game_player.x == @x and $game_player.y == @y
refresh
end
end
#================================================
# ■ Window_MapName
#================================================
class Window_MapName < Window_Base
#------------------------------------------------
# ● 初始化
#------------------------------------------------
def initialize
@map_id = $game_map.map_id
super(0, 0, 182, 52)
self.contents.font.size = 20
self.z = 151
refresh
end
#------------------------------------------------
# ● 刷新
#------------------------------------------------
def refresh
self.opacity = 255
self.contents_opacity = 255
name = $data_mapinfos[@map_id].name
width = self.contents.text_size(name).width
height = self.contents.text_size(name).height
self.width = width + 32
self.height = height + 32
self.contents = Bitmap.new(width, height)
self.contents.font.size = 20
self.x = (Graphics.width - self.width) / 2
self.y = (Graphics.height - self.height) / 2
self.contents.font.color = system_color
self.contents.draw_text(0, 0, width, 20, name, 1)
end
#------------------------------------------------
# ● 更新
#------------------------------------------------
def update
if $game_map.map_id != @map_id
@map_id = $game_map.map_id
refresh
self.opacity = 255
self.contents_opacity = 255
end
return if self.opacity == 0
self.opacity -= 5
self.contents_opacity -= 5
end
end
class Scene_Title < Scene_Base
#------------------------------------------------
# ● 数据库载入
#------------------------------------------------
alias old_ld load_database
def load_database
old_ld
$data_mapinfos = load_data("Data/MapInfos.rvdata")
end
end
class Scene_Map < Scene_Base
#------------------------------------------------
# ● 开始
#------------------------------------------------
alias old_start start
def start
old_start
@pos_window = Window_Pos.new
@mapname_window = Window_MapName.new
end
#------------------------------------------------
# ● 结束
#------------------------------------------------
alias old_ter terminate
def terminate
old_ter
@pos_window.dispose
@mapname_window.dispose
end
#------------------------------------------------
# ● 更新
#------------------------------------------------
alias old_update update
def update
old_update
@pos_window.update
@mapname_window.update
end
end
复制代码
先使用这个脚本
记住你要编辑事件的X,Y值
然后在编辑器里编辑就行了
作者:
独孤剑
时间:
2008-12-13 23:22
楼上的朋友:
这个脚本显示
class Scene_Title < Scene_Base
这一行出错啊?
能详细介绍一下这个脚本的使用吗?谢谢.....
作者:
八云紫
时间:
2008-12-13 23:27
话说, 这个脚本是 VX 用的呀~~~~ 不是 XP 的~~~
作者:
独孤剑
时间:
2008-12-13 23:38
那楼上能解决我的问题吗??
作者:
a5396982
时间:
2008-12-14 16:40
啊哈?XP的
#==========================================================================
# 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
#==========================================================================
XY_SWITCH = 25 # 当25号开关打开,本脚本才开始工作。
#==============================================================================
# ■ Window_XY
#------------------------------------------------------------------------------
# 显示坐标的窗口。
#==============================================================================
class Window_xy < Window_Base#注意前面那个window_xy是文件名
#--------------------------------------------------------------------------
# ● 初始化窗口
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 96)#最后面那个数字是宽要显示多个需要改大,前面一个是长~
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255 # 这个是背景透明
self.opacity = 255 # 这个是边框和背景都透明
self.contents_opacity = 255 # 这个是内容透明
self.visible = false
refresh
@x = $game_player.x
@y = $game_player.y
@id = $game_map.map_id
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
if $game_switches[XY_SWITCH] #确定开关是否打开,可以自己改变开关
@x = $game_player.x #获取角色X坐标
@y = $game_player.y #获取角色Y坐标
@id = $game_map.map_id #获取地图编号
self.contents.clear #清除以前的东西
$mapnames = load_data("Data/MapInfos.rxdata") #读取地图名文件
map_name = $mapnames[@id].name #获得地图名
self.contents.font.color = normal_color#颜色,这里是白色~
self.contents.draw_text(0, 0, 116, 32, map_name,2)
self.contents.font.color = system_color#颜色,暗蓝色
self.contents.draw_text(0, 32, 120, 32, "X:")#显示X这个字的位置,引号里面的内容随便改,比如"X坐标地址"
self.contents.font.color = normal_color#颜色,这里是白色~
self.contents.draw_text(0, 32, 52, 32, @x.to_s,2)
self.contents.font.color = system_color#上面那个是X坐标的变量,可以自己更改变量名~
self.contents.draw_text(64, 32, 128, 32, "Y:")#显示Y这个字~
self.contents.font.color = normal_color
self.contents.draw_text(0, 32, 116, 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 - 160
@xy_window.y = 480 - 96
@xy_window.opacity = 0
xy_66rpg_main
@xy_window.dispose
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
alias xy_66rpg_update update
def update
xy_66rpg_update
if $game_switches[XY_SWITCH]
@xy_window.visible = true
@xy_window.refresh if @xy_window.judge
else
@xy_window.visible = false
end
end
end
#==========================================================================
# 本脚本来自www.66rpg.com,用于任何游戏请保留此信息。别以为加密就可以del哦
#==========================================================================
复制代码
作者:
亮F
时间:
2008-12-14 19:32
我的东西又有用出了~`````````````{/cy}
自己下载来看http://rpg.blue/viewthread.php?tid=105167 [LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1