Project1
标题:
地图坐标及地图名显示
[打印本页]
作者:
亿万星辰
时间:
2008-1-23 19:04
标题:
地图坐标及地图名显示
单独拿出来发一下好了......
#==============================================================================
# ■ 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
复制代码
尽可能的往下放应该效果会好些.....
作者:
clamp135
时间:
2008-1-23 19:07
提示:
作者被禁止或删除 内容自动屏蔽
作者:
柳柳
时间:
2008-1-23 20:18
亿万那天咱们说的脚本也做一下吧{/tp}
作者:
亿万星辰
时间:
2008-1-23 21:02
以下引用
柳柳于2008-1-23 12:18:17
的发言:
亿万那天咱们说的脚本也做一下吧
那谁...你看第二页...
作者:
柳柳
时间:
2008-1-23 21:27
是的……so……
我觉得可能应该多更新一下主站的脚本了。
还得忍几天,要不我先招谁来帮忙一下……
作者:
CIS狂人
时间:
2008-1-23 21:35
主题:《显示地图名脚本》 原帖[LINE]1,#dddddd[/LINE]根据亿万星辰的脚本改来的,觉得还好,超级菜鸟来好了。RUBY高手不要BS我以为我骗人哈!
#==============================================================================
# ■ Window_Pos
#==============================================================================
class Window_Pos < Window_Base
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
def initialize
@map_id = $game_map.map_id
super(0, 0, 122, 52)
self.z = 151
self.contents.font.size = 15
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
name = $data_mapinfos[@map_id].name
self.contents.font.color = system_color
@x,@y = $game_player.x,$game_player.y
self.contents.draw_text(0, 0, 90, 20, "(#{name},#{@x},#{@y})", 1)
end
#--------------------------------------------------------------------------
# ● 更新
#--------------------------------------------------------------------------
def update
return if $game_player.x == @x and $game_player.y == @y or $game_map.map_id != @map_id
refresh
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
end
#--------------------------------------------------------------------------
# ● 结束
#--------------------------------------------------------------------------
alias old_ter terminate
def terminate
old_ter
@pos_window.dispose
end
#--------------------------------------------------------------------------
# ● 更新
#--------------------------------------------------------------------------
alias old_update update
def update
old_update
@pos_window.update
end
end
复制代码
作者:
亿万星辰
时间:
2008-1-24 00:19
很显然你简单的把
return if $game_player.x == @x and $game_player.y == @y or $game_map.map_id != @map_id
这两个脚本中的这两句合在一起是有问题的
作者:
5693744
时间:
2008-1-24 00:42
地图名称显示的时间在哪改```貌似太短了`````
作者:
亿万星辰
时间:
2008-1-24 02:02
有个 -= 5
把5改小些即可
作者:
hb3344
时间:
2008-1-24 05:16
老大 为什么我没有Scene_Base
提示是83行class Scene_Title < Scene_Base 这个出错呢。。。。 急 orz
作者:
superufo
时间:
2008-1-24 05:17
提示:
作者被禁止或删除 内容自动屏蔽
作者:
hb3344
时间:
2008-1-24 18:01
。。。。。我错了。。。。。因为我在编XP的。。。
作者:
柳柳
时间:
2008-1-25 05:34
发布完毕,VIP += 3{/gg}
作者:
CIS狂人
时间:
2008-1-29 05:47
是return if $game_player.x == @x and $game_player.y == @y and $game_map.map_id == @map_id
作者:
ask556
时间:
2008-2-10 21:21
提示:
作者被禁止或删除 内容自动屏蔽
作者:
亿万星辰
时间:
2008-2-12 22:40
super(0, 0, xxx, xxx)
前两位就是x y坐标,位置可自行调整
作者:
CIS狂人
时间:
2008-2-13 00:20
#==============================================================================
# ■ Window_Pos
#==============================================================================
class Window_Pos < Window_Base
#--------------------------------------------------------------------------
# ● 初始化
#--------------------------------------------------------------------------
def initialize
@map_id = $game_map.map_id
super(0, 0, 122, 52)
self.z = 151
self.contents.font.size = 15
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
name = $data_mapinfos[@map_id].name
self.contents.font.color = system_color
@x,@y = $game_player.x,$game_player.y
self.contents.draw_text(0, 0, 90, 20, "(#{name},#{@x},#{@y})", 1)
end
#--------------------------------------------------------------------------
# ● 更新
#--------------------------------------------------------------------------
def update
return if $game_player.x == @x and $game_player.y == @y and $game_map.map_id == @map_id
refresh
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
end
#--------------------------------------------------------------------------
# ● 结束
#--------------------------------------------------------------------------
alias old_ter terminate
def terminate
old_ter
@pos_window.dispose
end
#--------------------------------------------------------------------------
# ● 更新
#--------------------------------------------------------------------------
alias old_update update
def update
old_update
@pos_window.update
end
end
复制代码
这个呢...修正完的..
作者:
飞起一键盘
时间:
2008-2-13 00:26
a ....强 ......
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1