赞 | 1 |
VIP | 392 |
好人卡 | 225 |
积分 | 46 |
经验 | 177731 |
最后登录 | 2020-12-8 |
在线时间 | 2037 小时 |
Lv3.寻梦者 虚空人形
- 梦石
- 0
- 星屑
- 4604
- 在线时间
- 2037 小时
- 注册时间
- 2011-8-11
- 帖子
- 3398
|
把下面这套脚本放到Main上方即可,
这脚本除了显示当前的地图名外还会显示音乐和地图坐标,
不想要就把脚本中带“音乐”和“位置”的两行前加#注释掉即可。- #==============================================================================
- # ■ Game_Player
- #------------------------------------------------------------------------------
- # 处理玩家人物的类。拥有事件启动的判定、地图的卷动等功能。
- # 本类的实例请参考 $game_player 。
- #==============================================================================
- class Game_Player < Game_Character
-
- def getX
- @x
- end
-
- def getY
- @y
- end
-
- end
- #==============================================================================
- # ■ Scene_Menu
- #------------------------------------------------------------------------------
- # 菜单画面
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # ● 生成窗口
- #--------------------------------------------------------------------------
- def create_gold_window
- @gold_window = Window_Gold.new
- @gold_window.x = 0
- @gold_window.y = Graphics.height - @gold_window.height
- # 生成地图信息窗口
- @mapinfos_window = Window_MapInfo.new
- @mapinfos_window.x = 0
- @mapinfos_window.y = Graphics.height - @mapinfos_window.height - @gold_window.height
-
- end
-
- end
- #==============================================================================
- # ■ Window_MapInfo
- #------------------------------------------------------------------------------
- # 显示当前信息的窗口。 By SkyZH
- #==============================================================================
- class Window_MapInfo < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, window_width, fitting_height(3))
- self.opacity = 100
- refresh
- end
- #--------------------------------------------------------------------------
- # ● 获取窗口的宽度
- #--------------------------------------------------------------------------
- def window_width
- return 160
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = normal_color
-
- @a=$game_map.width
- @b=$game_map.height
- @BGMNAME=RPG::BGM.last.name
-
-
- draw_text(0, 0, window_width-24, line_height,$game_map.display_name,2)
- draw_text(0, line_height, window_width-24, line_height,"音乐 " + @BGMNAME.to_s,2)
- draw_text(0, line_height*2, window_width-24, line_height,"位置 " + $game_player.getX.to_s + "," + $game_player.getY.to_s,2)
- end
- end
- class Spriteset_Map
- #--------------------------------------------------------------------------
- # ● 初始化对象
- #--------------------------------------------------------------------------
- def initialize
- create_viewports
- create_tilemap
- create_parallax
- create_characters
- create_shadow
- create_weather
- create_pictures
- create_timer
- @MapInfoWin=Window_MapInfo.new
- update
- end
-
- def dispose
- dispose_tilemap
- dispose_parallax
- dispose_characters
- dispose_shadow
- dispose_weather
- dispose_pictures
- dispose_timer
- dispose_viewports
- @MapInfoWin.dispose
- end
-
- def update
- update_tileset
- update_tilemap
- update_parallax
- update_characters
- update_shadow
- update_weather
- update_pictures
- update_timer
- update_viewports
- if $game_switches[40]==false then
- @MapInfoWin.visible=false
- else
- @MapInfoWin.visible=true
- end
- @MapInfoWin.refresh
- end
- end
复制代码 名称的话:
在Scene_Menu的def start super后面插入 create_playtime_window
再在Main上方插入- #==============================================================================
-
- # ■ Window_Timer
-
- #------------------------------------------------------------------------------
-
- # 显示系统当前时间的窗口
-
- #==============================================================================
-
- class Window_Timer < Window_Base
-
- #--------------------------------------------------------------------------
-
- # ● 初始化对象
-
- #--------------------------------------------------------------------------
-
- def initialize
-
- super(0, 0, window_width, fitting_height(3))
-
- refresh
-
- end
-
- #--------------------------------------------------------------------------
-
- # ● 获取窗口的宽度
-
- #--------------------------------------------------------------------------
-
- def window_width
-
- return 160
-
- end
-
- #--------------------------------------------------------------------------
-
- # ● 刷新
-
- #--------------------------------------------------------------------------
-
- def refresh
-
- self.contents.clear
-
- self.contents.font.color = system_color
-
- self.contents.draw_text(0, 0, 120, 32, "当前时间") #显示文本位置,我没有细调。。
-
- @total_sec = Graphics.frame_count / Graphics.frame_rate
-
- t = Time.now
-
- $game_variables[204] = t.wday # 星期
-
- $game_variables[208] = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][$game_variables[204]]
-
- text = sprintf("%02d:%02d:%02d", t.hour, t.min, t.sec)
- text2 = sprintf("%02d.%02d.%02d", t.year, t.month, t.day)
- text3 = sprintf($game_variables[208])
- self.contents.font.color = normal_color
-
- self.contents.draw_text(0, 20, 110, 32, text2, 2)
-
- self.contents.draw_text(-25, 40, 110, 32, text3, 2)
-
- self.contents.draw_text(-3, 60, 110, 32, text, 2)
-
- end
-
- #--------------------------------------------------------------------------
-
- # ● 打开窗口
-
- #--------------------------------------------------------------------------
-
- def open
-
- refresh
-
- super
-
- end
-
- end
- #encoding:utf-8
-
- #==============================================================================
-
- # ■ Window_PlayTime
-
- #------------------------------------------------------------------------------
-
- # 显示游戏时间的窗口
-
- #==============================================================================
-
- class Window_PlayTime < Window_Base
-
- #--------------------------------------------------------------------------
-
- # ● 初始化对象
-
- #--------------------------------------------------------------------------
-
- def initialize
-
- super(0, 0, window_width, fitting_height(2))#游戏时间窗口的高度
-
- refresh
-
- end
-
- #--------------------------------------------------------------------------
-
- # ● 获取窗口的宽度
-
- #--------------------------------------------------------------------------
-
- def window_width
-
- return 160 #游戏时间窗口的宽度
-
- end
-
- #--------------------------------------------------------------------------
-
- # ● 刷新
-
- #--------------------------------------------------------------------------
-
- def refresh
-
- contents.clear
-
- self.contents.font.color = system_color
-
- self.contents.draw_text(0, 0, 120, 32, "游戏时间")
-
- @total_sec = Graphics.frame_count / Graphics.frame_rate
-
- hour = @total_sec / 60 / 60
-
- min = @total_sec / 60 % 60
-
- sec = @total_sec % 60
-
- text = sprintf("%02d:%02d:%02d", hour, min, sec)
-
- self.contents.font.color = normal_color
-
- self.contents.draw_text(0, 20, 120, 32, text, 2)
-
- end
-
- #--------------------------------------------------------------------------
-
- # ● 打开窗口
-
- #--------------------------------------------------------------------------
-
- def open
-
- refresh
-
- super
-
- end
-
- end
复制代码 最后直接上工程(RGSS300.dll自行添加): |
评分
-
查看全部评分
|