赞 | 0 |
VIP | 10 |
好人卡 | 49 |
积分 | 10 |
经验 | 22958 |
最后登录 | 2020-8-1 |
在线时间 | 2161 小时 |
Lv3.寻梦者 酱油的
- 梦石
- 0
- 星屑
- 1035
- 在线时间
- 2161 小时
- 注册时间
- 2007-12-22
- 帖子
- 3271
|
本帖最后由 禾西 于 2011-5-11 14:12 编辑
剛好全2有這個東西,怎麼用不需要解釋了吧- # ▼▲▼ XRXS20. マップ名表示ウィンドウ 1.01 ▼▲▼
- # by にふ, 桜雅 在土
- #=======================================================
- # note:11.27.10
- class Scene_Map
- #//不顯示地圖名字的地圖ID組
- #//Hidden_Map_IDs = [1,2,3]
- Hidden_Map_IDs = [1,2,3,20,50,112,113,114,115,116,117,118,119,143,163,238,
- 239,270,271,272,273,274,275,276,326,375,376,377,378,388,389,390,391,392,393,
- 394,395,396]
- end
- =======================
- # ■ Window_Map_Name
- #------------------------------------------------------------------------------
- # マップ名を表示するウィンドウです。
- #==============================================================================
- class Window_Map_Name < Window_Base
- #--------------------------------------------------------------------------
- # ● オブジェクト初期
- #--------------------------------------------------------------------------
- def initialize
- super(460, 0, 180, 64)
- #//這里可以加外觀
- #self.windowskin = RPG::Cache.windowskin("3")
- self.windowskin = nil
- self.contents = Bitmap.new(width-32, height-32)
- self.opacity = 0
- @showing_time = 0
- @text_color = Color.new(255,255,255,255) # 地名:描写文字色
- @hidden_flag = Scene_Map::Hidden_Map_IDs.include? ($game_map.map_id)
- end
- #--------------------------------------------------------------------------
- # ● テキスト設定
- # text : ウィンドウに表示する文字列
- # align : アラインメント (0..左揃え、1..中央揃え、2..右揃え)
- #--------------------------------------------------------------------------
- def set_text(text, align = 2)
- # テキストとアラインメントの少なくとも一方が前回と違っている場合
- if text != @text or align != @align
- @text = text
- @align = align
- if Scene_Map::Hidden_Map_IDs.include? ($game_map.map_id)
- self.visible = false
- @showing_time = 0
- return
- end
- self.opacity = 0
- self.contents_opacity = 0
- self.x = 0
- @target_x = 330
- @target_opacity = 255
- @showing_time = 150
- # テキストを再描画
- self.contents.clear
- x = 4
- y = 0
- self.contents.font.color = Color.new( 0, 0, 0, 192)
- self.contents.draw_text(x+2, y+2, self.width - 40, 32, "-"+text+"-",1)
- self.contents.font.color = Color.new( 64, 64, 64, 192)
- self.contents.draw_text(x-1, y-1, self.width - 40, 32, "-"+text+"-", 1)
- self.contents.draw_text(x+1, y-1, self.width - 40, 32, "-"+text+"-", 1)
- self.contents.draw_text(x-1, y+1, self.width - 40, 32, "-"+text+"-", 1)
- self.contents.draw_text(x+1, y+1, self.width - 40, 32, "-"+text+"-", 1)
- self.contents.font.color = @text_color
- self.contents.draw_text(x, y, self.width - 40, 32, "-"+text+"-", 1)
- self.visible = true
- end
- if @showing_time != 0
- @showing_time -= 1
- if @showing_time < 150 and @showing_time > 100
- d = @showing_time - 100
- self.x = (self.x * (d - 1) + @target_x) / d
- self.opacity = (self.opacity * (d - 1) + 255) / d
- self.contents_opacity = self.opacity
- elsif @showing_time < 10 and @showing_time > 0
- d = @showing_time
- self.x = (self.x * (d - 1) + 480) / d
- self.opacity = (self.opacity * (d - 1) + 0) / d
- self.contents_opacity = self.opacity
- elsif @showing_time <= 0
- # 一定時間経過したので表示を消す
- self.contents.clear
- end
- end
- end
- end
- #==============================================================================
- # ■ Scene_Map
- #==============================================================================
- class Scene_Map
- #--------------------------------------------------------------------------
- # ● メイン処理
- #--------------------------------------------------------------------------
- alias xrxs20_main main
- def main
- # 地名ウィンドウを作成
- @map_name_window = Window_Map_Name.new
- @map_name_window.opacity = 0
- # 戻す
- xrxs20_main
- # 地名ウィンドウを解放
- @map_name_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- alias xrxs20_update update
- def update
- # 地名ウィンドウの更新
- @map_name_window.set_text($game_map.name, 1)
- xrxs20_update
- end
- end
- $map_infos = {}
- load_data("Data/MapInfos.rxdata").each do |key, ref|
- $map_infos[key] = ref.name
- end
- $map_infos.freeze
- #==============================================================================
- # ■ Game_Map
- #==============================================================================
- class Game_Map
- #--------------------------------------------------------------------------
- # ● マップ名を取得
- #--------------------------------------------------------------------------
- def name
- $map_infos[@map_id]
- end
- end
复制代码 |
评分
-
查看全部评分
|