Home > RGSS Script Reference > Window_Status
Window_Status
Inherits from: Window_Base
Description: This window shows an actor's status in the main menu.
class Window_Status < Window_Base
# ------------------------------------
def initialize(actor)
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
@actor = actor
refresh
end
# ------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 40, 112)
draw_actor_name(@actor, 4, 0)
draw_actor_class(@actor, 4 + 144, 0)
draw_actor_level(@actor, 96, 32)
draw_actor_state(@actor, 96, 64)
draw_actor_hp(@actor, 96, 112, 172)
draw_actor_sp(@actor, 96, 144, 172)
draw_actor_parameter(@actor, 96, 192, 0)
draw_actor_parameter(@actor, 96, 224, 1)
draw_actor_parameter(@actor, 96, 256, 2)
draw_actor_parameter(@actor, 96, 304, 3)
draw_actor_parameter(@actor, 96, 336, 4)
draw_actor_parameter(@actor, 96, 368, 5)
draw_actor_parameter(@actor, 96, 400, 6)
self.contents.font.color = system_color
self.contents.draw_text(320, 48, 80, 32, "EXP")
self.contents.draw_text(320, 80, 80, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(320, 160, 96, 32, "Equipment")
draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
end
# ------------------------------------
def dummy
self.contents.font.color = system_color
self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
end
end
|
Actor: The actor whose status is to be shown.
Initialize
Arguments:
Actor: The actor whose status is to be shown.
Local Variables: None
How it Works: This method initializes the window. Both the x and y coordinate of the upper-left pixel of the window are set to 0. The width of the window is set to 640, and the height is set to 480. The @actor instance variable is initialized, and the status is drawn with the refresh method.
Refresh
Arguments: None
Local Variables: None
How it Works: This method draws the window's contents. The window's contents are first cleared. The actor's graphic is drawn at x coordinate 40 and y coordinate 112. The actor's class is drawn at x coordinate 148 and y coordinate 0. The actor's level is drawn at x coordinate 96 and y coordinate 32. The actor's status effects at x coordinate 96 and y coordinate 64. The actor's HP is drawn at x coordinate 96 and y coordinate 112 and a text width of 172. The actor's SP is drawn at x coordinate 96 and y coordinate 144 and a text width of 172. Note that both the HP and SP values are drawn with a text width of 172, meaning that both the current and maximum values will be shown since 172 is more than the threshold width of 144. Next, the actor's attack power, physical defense, magic defense, strength, dexterity, agility, and intelligence are drawn, The x coordinates for all of these is 96, and the y coordinates are 192, 224, 256, 288, 320, 352, and 384, respectively. Next, the word "EXP" is drawn in the system color at x coordinate 320 and y coordinate 48. The word "NEXT" is drawn in the system color at x coordinate 320 and y coordinate 80. Now, the actor's current experience point value is drawn at x coordinate 400 and y coordinate 48 and the number of experience points the actor needs to reach the next level is drawn at x coordinate 400 and y coordinate 80, both in the normal color. The word "Equipment" is then drawn in the system color. Below that, the names of the character's currently equipped weapon, shield, helmet, armor, and accessory are drawn, all at x coordinate 336. The y coordinates for these five entries are 208, 256, 304, 352, and 400, respectively.
Dummy
Arguments: None
Local Variables: None
How it Works: I have no idea why this method is included. It seems to serve no useful purpose, and is not called anywhere else in the standard scripts.
|
|