Class: Window_Status
- Inherits:
-
Window_Selectable
- Object
- Window
- Window_Base
- Window_Selectable
- Window_Status
- Defined in:
- lib/rgss3_default_scripts/Window_Status.rb
Overview
** Window_Status
This window displays full status specs on the status screen.
Instance Attribute Summary
Attributes inherited from Window_Selectable
#cursor_all, #cursor_fix, #help_window, #index
Instance Method Summary collapse
-
#actor=(actor) ⇒ Object
————————————————————————– * Set Actor ————————————————————————–.
-
#draw_basic_info(x, y) ⇒ Object
————————————————————————– * Draw Basic Information ————————————————————————–.
-
#draw_block1(y) ⇒ Object
————————————————————————– * Draw Block 1 ————————————————————————–.
-
#draw_block2(y) ⇒ Object
————————————————————————– * Draw Block 2 ————————————————————————–.
-
#draw_block3(y) ⇒ Object
————————————————————————– * Draw Block 3 ————————————————————————–.
-
#draw_block4(y) ⇒ Object
————————————————————————– * Draw Block 4 ————————————————————————–.
-
#draw_description(x, y) ⇒ Object
————————————————————————– * Draw Description ————————————————————————–.
-
#draw_equipments(x, y) ⇒ Object
————————————————————————– * Draw Equipment ————————————————————————–.
-
#draw_exp_info(x, y) ⇒ Object
————————————————————————– * Draw Experience Information ————————————————————————–.
-
#draw_horz_line(y) ⇒ Object
————————————————————————– * Draw Horizontal Line ————————————————————————–.
-
#draw_parameters(x, y) ⇒ Object
————————————————————————– * Draw Parameters ————————————————————————–.
-
#initialize(actor) ⇒ Window_Status
constructor
————————————————————————– * Object Initialization ————————————————————————–.
-
#line_color ⇒ Object
————————————————————————– * Get Color of Horizontal Line ————————————————————————–.
-
#refresh ⇒ Object
————————————————————————– * Refresh ————————————————————————–.
Methods inherited from Window_Selectable
#active=, #bottom_row, #bottom_row=, #call_cancel_handler, #call_handler, #call_ok_handler, #call_update_help, #cancel_enabled?, #clear_item, #col_max, #contents_height, #current_item_enabled?, #cursor_down, #cursor_left, #cursor_movable?, #cursor_pagedown, #cursor_pageup, #cursor_right, #cursor_up, #draw_all_items, #draw_item, #ensure_cursor_visible, #handle?, #height=, #horizontal?, #item_height, #item_max, #item_rect, #item_rect_for_text, #item_width, #ok_enabled?, #page_item_max, #page_row_max, #process_cancel, #process_cursor_move, #process_handling, #process_ok, #process_pagedown, #process_pageup, #redraw_current_item, #redraw_item, #row, #row_max, #select, #set_handler, #spacing, #top_row, #top_row=, #unselect, #update, #update_cursor, #update_help, #update_padding, #update_padding_bottom
Methods inherited from Window_Base
#activate, #actor_name, #calc_line_height, #change_color, #close, #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, #open, #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, #update_close, #update_open, #update_padding, #update_tone
Constructor Details
#initialize(actor) ⇒ Window_Status
-
Object Initialization
11 12 13 14 15 16 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 11 def initialize(actor) super(0, 0, Graphics.width, Graphics.height) @actor = actor refresh activate end |
Instance Method Details
#actor=(actor) ⇒ Object
-
Set Actor
20 21 22 23 24 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 20 def actor=(actor) return if @actor == actor @actor = actor refresh end |
#draw_basic_info(x, y) ⇒ Object
-
Draw Basic Information
85 86 87 88 89 90 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 85 def draw_basic_info(x, y) draw_actor_level(@actor, x, y + line_height * 0) draw_actor_icons(@actor, x, y + line_height * 1) draw_actor_hp(@actor, x, y + line_height * 2) draw_actor_mp(@actor, x, y + line_height * 3) end |
#draw_block1(y) ⇒ Object
-
Draw Block 1
41 42 43 44 45 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 41 def draw_block1(y) draw_actor_name(@actor, 4, y) draw_actor_class(@actor, 128, y) draw_actor_nickname(@actor, 288, y) end |
#draw_block2(y) ⇒ Object
-
Draw Block 2
49 50 51 52 53 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 49 def draw_block2(y) draw_actor_face(@actor, 8, y) draw_basic_info(136, y) draw_exp_info(304, y) end |
#draw_block3(y) ⇒ Object
-
Draw Block 3
57 58 59 60 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 57 def draw_block3(y) draw_parameters(32, y) draw_equipments(288, y) end |
#draw_block4(y) ⇒ Object
-
Draw Block 4
64 65 66 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 64 def draw_block4(y) draw_description(4, y) end |
#draw_description(x, y) ⇒ Object
-
Draw Description
122 123 124 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 122 def draw_description(x, y) draw_text_ex(x, y, @actor.description) end |
#draw_equipments(x, y) ⇒ Object
-
Draw Equipment
114 115 116 117 118 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 114 def draw_equipments(x, y) @actor.equips.each_with_index do |item, i| draw_item_name(item, x, y + line_height * i) end end |
#draw_exp_info(x, y) ⇒ Object
-
Draw Experience Information
100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 100 def draw_exp_info(x, y) s1 = @actor.max_level? ? "-------" : @actor.exp s2 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp s_next = sprintf(Vocab::ExpNext, Vocab::level) change_color(system_color) draw_text(x, y + line_height * 0, 180, line_height, Vocab::ExpTotal) draw_text(x, y + line_height * 2, 180, line_height, s_next) change_color(normal_color) draw_text(x, y + line_height * 1, 180, line_height, s1, 2) draw_text(x, y + line_height * 3, 180, line_height, s2, 2) end |
#draw_horz_line(y) ⇒ Object
-
Draw Horizontal Line
70 71 72 73 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 70 def draw_horz_line(y) line_y = y + line_height / 2 - 1 contents.fill_rect(0, line_y, contents_width, 2, line_color) end |
#draw_parameters(x, y) ⇒ Object
-
Draw Parameters
94 95 96 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 94 def draw_parameters(x, y) 6.times {|i| draw_actor_param(@actor, x, y + line_height * i, i + 2) } end |
#line_color ⇒ Object
-
Get Color of Horizontal Line
77 78 79 80 81 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 77 def line_color color = normal_color color.alpha = 48 color end |
#refresh ⇒ Object
-
Refresh
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/rgss3_default_scripts/Window_Status.rb', line 28 def refresh contents.clear draw_block1 (line_height * 0) draw_horz_line(line_height * 1) draw_block2 (line_height * 2) draw_horz_line(line_height * 6) draw_block3 (line_height * 7) draw_horz_line(line_height * 13) draw_block4 (line_height * 14) end |