Class: Window_MapName

Inherits:
Window_Base show all
Defined in:
Window_MapName.rb

Overview

** Window_MapName


This window displays the map name.

Instance Method Summary (collapse)

Methods inherited from Window_Base

#activate, #actor_name, #calc_line_height, #change_color, #contents_height, #contents_width, #convert_escape_characters, #create_contents, #crisis_color, #deactivate, #dispose, #draw_actor_class, #draw_actor_face, #draw_actor_graphic, #draw_actor_hp, #draw_actor_icons, #draw_actor_level, #draw_actor_mp, #draw_actor_name, #draw_actor_nickname, #draw_actor_param, #draw_actor_simple_status, #draw_actor_tp, #draw_character, #draw_currency_value, #draw_current_and_max_values, #draw_face, #draw_gauge, #draw_icon, #draw_item_name, #draw_text, #draw_text_ex, #fitting_height, #gauge_back_color, #hide, #hp_color, #hp_gauge_color1, #hp_gauge_color2, #knockout_color, #line_height, #make_font_bigger, #make_font_smaller, #mp_color, #mp_cost_color, #mp_gauge_color1, #mp_gauge_color2, #normal_color, #obtain_escape_code, #obtain_escape_param, #param_change_color, #party_member_name, #pending_color, #power_down_color, #power_up_color, #process_character, #process_draw_icon, #process_escape_character, #process_new_line, #process_new_page, #process_normal_character, #reset_font_settings, #show, #standard_padding, #system_color, #text_color, #text_size, #tp_color, #tp_cost_color, #tp_gauge_color1, #tp_gauge_color2, #translucent_alpha, #update_close, #update_open, #update_padding, #update_tone

Constructor Details

- (Window_MapName) initialize


  • Object Initialization




11
12
13
14
15
16
17
# File 'Window_MapName.rb', line 11

def initialize
  super(0, 0, window_width, fitting_height(1))
  self.opacity = 0
  self.contents_opacity = 0
  @show_count = 0
  refresh
end

Instance Method Details

- (Object) back_color1


  • Get Background Color 1




87
88
89
# File 'Window_MapName.rb', line 87

def back_color1
  Color.new(0, 0, 0, 192)
end

- (Object) back_color2


  • Get Background Color 2




93
94
95
# File 'Window_MapName.rb', line 93

def back_color2
  Color.new(0, 0, 0, 0)
end

- (Object) close


  • Close Window




60
61
62
63
# File 'Window_MapName.rb', line 60

def close
  @show_count = 0
  self
end

- (Object) draw_background(rect)


  • Draw Background




77
78
79
80
81
82
83
# File 'Window_MapName.rb', line 77

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

- (Object) open


  • Open Window




51
52
53
54
55
56
# File 'Window_MapName.rb', line 51

def open
  refresh
  @show_count = 150
  self.contents_opacity = 0
  self
end

- (Object) refresh


  • Refresh




67
68
69
70
71
72
73
# File 'Window_MapName.rb', line 67

def refresh
  contents.clear
  unless $game_map.display_name.empty?
    draw_background(contents.rect)
    draw_text(contents.rect, $game_map.display_name, 1)
  end
end

- (Object) update


  • Frame Update




27
28
29
30
31
32
33
34
35
# File 'Window_MapName.rb', line 27

def update
  super
  if @show_count > 0 && $game_map.name_display
    update_fadein
    @show_count -= 1
  else
    update_fadeout
  end
end

- (Object) update_fadein


  • Update Fadein




39
40
41
# File 'Window_MapName.rb', line 39

def update_fadein
  self.contents_opacity += 16
end

- (Object) update_fadeout


  • Update Fadeout




45
46
47
# File 'Window_MapName.rb', line 45

def update_fadeout
  self.contents_opacity -= 16
end

- (Object) window_width


  • Get Window Width




21
22
23
# File 'Window_MapName.rb', line 21

def window_width
  return 240
end