Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ■ Window_MapName
- #------------------------------------------------------------------------------
- # マップ名を表示するウィンドウです。
- #==============================================================================
- module Ul01
- Window_width = 250
- Back_color1 = Color.new(100, 200, 100, 192)
- Back_color2 = Color.new(200, 200, 200, 0)
- Map_Name_Position = [100,10]
- Map_Name_Font = [ "AR ESSENCE" ]
- Map_Name_Font_Bold = false
- Map_Name_Font_Italic = true
- end
- class Window_MapName < Window_Base
- attr_accessor :back_color1
- attr_accessor :back_color2
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize
- super( window_x,window_y,window_width, fitting_height(1))
- self.opacity = 0
- self.contents_opacity = 0
- setting
- @show_count = 0
- refresh
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウ幅の取得
- #--------------------------------------------------------------------------
- def setting
- self.contents.font.name = Ul01::Map_Name_Font
- self.contents.font.size = 30
- self.contents.font.bold = Ul01::Map_Name_Font_Bold
- self.contents.font.italic = Ul01::Map_Name_Font_Italic
- end
- def window_width
- return Ul01::Window_width
- end
- def window_x
- return Ul01::Map_Name_Position[0]
- end
- def window_y
- return Ul01::Map_Name_Position[1]
- end
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- def update
- super
- if @show_count > 0 && $game_map.name_display
- update_fadein
- @show_count -= 1
- else
- update_fadeout
- end
- end
- #--------------------------------------------------------------------------
- # ● フェードインの更新
- #--------------------------------------------------------------------------
- def update_fadein
- self.contents_opacity += 16
- end
- #--------------------------------------------------------------------------
- # ● フェードアウトの更新
- #--------------------------------------------------------------------------
- def update_fadeout
- self.contents_opacity -= 16
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウを開く
- #--------------------------------------------------------------------------
- def open
- refresh
- @show_count = 150
- self.contents_opacity = 0
- self
- end
- #--------------------------------------------------------------------------
- # ● ウィンドウを閉じる
- #--------------------------------------------------------------------------
- def close
- @show_count = 0
- self
- end
- #--------------------------------------------------------------------------
- # ● リフレッシュ
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- unless $game_map.display_name.empty?
- @map = "#{$data_mapinfos[$game_map.map_id].name}"
- #@map2 = "#{$game_map.display_name}"
- draw_background(contents.rect)
- draw_text(contents.rect,@map, 0)
- #draw_text(contents.rect,@map2, 2)
- end
- end
- #--------------------------------------------------------------------------
- # ● 背景の描画
- #--------------------------------------------------------------------------
- def draw_background(rect)
- temp_rect = rect.clone
- temp_rect.width /= 2
- contents.gradient_fill_rect(temp_rect, back_color2, back_color1)
- temp_rect.x = temp_rect.width
- contents.gradient_fill_rect(temp_rect, back_color1, back_color2)
- end
- #--------------------------------------------------------------------------
- # ● 背景色 1 の取得
- #--------------------------------------------------------------------------
- def back_color1
- return Ul01::Back_color1
- end
- #--------------------------------------------------------------------------
- # ● 背景色 2 の取得
- #--------------------------------------------------------------------------
- def back_color2
- return Ul01::Back_color2
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement