Submit Your Article Guild Wars 2 Forum RPG Maker VX.com
 
RPG Maker
 

 Username:
 Password:
   Not a member? Register!



Home > RGSS Script Reference > Window_EquipLeft

Window_EquipLeft


Inherits from: Window_Base

Description: This window shows the stat changes associated with equipping or removing a weapon as they are highlighted on the item window below this window.

Code


class Window_EquipLeft < Window_Base
# ------------------------------------
def initialize(actor)
    super(0, 64, 272, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
# ------------------------------------
  def refresh
    self.contents.clear
    draw_actor_name(@actor, 4, 0)
    draw_actor_level(@actor, 4, 32)
    draw_actor_parameter(@actor, 4, 64, 0)
    draw_actor_parameter(@actor, 4, 96, 1)
    draw_actor_parameter(@actor, 4, 128, 2)
    if @new_atk != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 64, 40, 32, "", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 64, 36, 32, @new_atk.to_s, 2)
    end
    if @new_pdef != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 96, 40, 32, "", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 96, 36, 32, @new_pdef.to_s, 2)
    end
    if @new_mdef != nil
      self.contents.font.color = system_color
      self.contents.draw_text(160, 128, 40, 32, "", 1)
      self.contents.font.color = normal_color
      self.contents.draw_text(200, 128, 36, 32, @new_mdef.to_s, 2)
    end
  end
# ------------------------------------ 
 def set_new_parameters(new_atk, new_pdef, new_mdef)
    if @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
      @new_atk = new_atk
      @new_pdef = new_pdef
      @new_mdef = new_mdef
      refresh
    end
  end
end

Properties


Actor: The actor whose equipment is being changed.

New_Atk: The actor's new attack power if the currently selected item is equipped.

New_Pdef: The actor's new physical defense if the currently selected item is equipped.

New_Mdef: The actor's new magic defense if the currently selected item is equipped.

Methods


Initialize

Arguments:
Actor: The actor whose equipment is being changed.
Local Variables: None

How it Works: This method initializes the window. First, the window's x coordinate is initialized to 0, the y coordinate is initialized to 64, the width to 272, and the height to 192. Then, the @actor variables is set to the actor whose equipment is being changed. The window is then populated with data by the refresh method.

Refresh

Arguments: None
Local Variables: None

How it Works: This method draws the window's contents. First, the window's contents are cleared. First, the actor's name, level, current attack power, current physical defense, and current magical defense, all at x coordinate 4 and the y coordinate starts at 0, increasing by 32 with each stat. The second part of the method draws the new stats the actor would have if it equipped the item currently selected in the item window below this window. In all three cases, an arrow character is drawn in the system color on the same line as the current stat of that type, to the right of that stat and to the left of the new stat. The new stats are drawn at x coordinate 200. The y coordinate is 64 for the new attack power, 96, for the new physical defense, and 128 for the new magical defense. Note that these values are drawn right-aligned because of the optional argument "2" in the self.contents.draw_text statement.

Set_New_Parameters

Arguments:
New_Atk: The new attack power to display
New_Pdef: The new physical defense to display
New_Mdef: The new magic defense to display
Local Variables: None

How it Works: This method simply sets the @new_atk, @new_pdef, and @new_mdef instance variables to the values passed to this method and updates the window contents to reflect this. 
Syntax
@
@@
$
alias
[array index]
attr_accessor
attr_reader
attr_writer
class
def
do
ensure
for
if
[iterator]
key => value
new
next
nil
redo
require
return
rescue
self
super
undef
unless
until
while
yield

Classes
Arrow_Actor
Arrow_Base
Arrow_Enemy
Game_Actor
Game_Actors
Game_BattleAct
Game_Battler
Game_Character
Game_Common
Game_Enemy
Game_Event
Game_Map
Game_Party
Game_Picture
Game_Player
Game_Screen
Game_SlfSwitch
Game_Switches
Game_System
Game_Troop
Game_Variables
Interpreter
Scene_Debug
Scene_End
Scene_Equip
Scene_File
Scene_Gameover
Scene_Item
Scene_Load
Scene_Map
Scene_Menu
Scene_Name
Scene_Save
Scene_Shop
Scene_Skill
Scene_Status
Scene_Title
Sprite_Battler
Sprite_Character
Sprite_Picture
Sprite_Timer
Spriteset_Battle
Spriteset_Map
Window_Base
Window_Battleresult
Window_Battlestatus
Window_Command
Window_DebugLeft
Window_DebugRight
Window_EquipItem
Window_EquipLeft
Window_EquipRight
Window_Gold
Window_Help
Window_InputNumb
Window_Item
Window_MenuStatus
Window_Message
Window_NameEdit
Window_NameInput
Window_PartyCom
Window_PlayTime
Window_SaveFile
Window_Selectable
Window_ShopBuy
Window_ShopCom
Window_ShopNum
Window_ShopSell
Window_ShopStatus
Window_Skill
Window_SkillStatus
Window_Status
Window_Steps
Window_Target

Other
Class Hierarchy
Global Variables


RPG RPG Revolution
RPG RPG Revolution is your #1 stop for game development and console RPG games, as well as those created by people like you. Link to us to support us, so we may grow to be better website community for you.

RPG RPG Revolution is an Privacy Policy and Legal