| 
本帖最后由 funxlww 于 2017-8-15 19:19 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 我想修改ItemCategory的xy坐标,就是物品栏上面有选项的那一块,x坐标是可以改的,但是y坐标怎么改都不会动
 #encoding:utf-8#==============================================================================# ■ Window_ItemCategory#------------------------------------------------------------------------------#  物品画面和商店画面中,显示装备、所持物品等项目列表的窗口。#============================================================================== class Window_ItemCategory < Window_HorzCommand  #--------------------------------------------------------------------------  # ● 定义实例变量  #--------------------------------------------------------------------------  attr_reader   :item_window  #--------------------------------------------------------------------------  # ● 初始化对象  #--------------------------------------------------------------------------  def initialize    super(0+100, 100)#我在这里修改xy坐标,x可以修改,但是y轴不管输入什么数字都不会动  end  #--------------------------------------------------------------------------  # ● 获取窗口的宽度  #--------------------------------------------------------------------------  def window_width    360#Graphics.width - 100  end  #--------------------------------------------------------------------------  # ● 获取列数  #--------------------------------------------------------------------------  def col_max    return 4  end  #--------------------------------------------------------------------------  # ● 更新画面  #--------------------------------------------------------------------------  def update    super    @item_window.category = current_symbol if @item_window  end  #--------------------------------------------------------------------------  # ● 生成指令列表  #--------------------------------------------------------------------------  def make_command_list    add_command(Vocab::item,     :item)    add_command(Vocab::weapon,   :weapon)    add_command(Vocab::armor,    :armor)    add_command(Vocab::key_item, :key_item)  end  #--------------------------------------------------------------------------  # ● 设置物品窗口  #--------------------------------------------------------------------------  def item_window=(item_window)    @item_window = item_window    update  endend
#encoding:utf-8 
#============================================================================== 
# ■ Window_ItemCategory 
#------------------------------------------------------------------------------ 
#  物品画面和商店画面中,显示装备、所持物品等项目列表的窗口。 
#============================================================================== 
  
class Window_ItemCategory < Window_HorzCommand 
  #-------------------------------------------------------------------------- 
  # ● 定义实例变量 
  #-------------------------------------------------------------------------- 
  attr_reader   :item_window 
  #-------------------------------------------------------------------------- 
  # ● 初始化对象 
  #-------------------------------------------------------------------------- 
  def initialize 
    super(0+100, 100)#我在这里修改xy坐标,x可以修改,但是y轴不管输入什么数字都不会动 
  end 
  #-------------------------------------------------------------------------- 
  # ● 获取窗口的宽度 
  #-------------------------------------------------------------------------- 
  def window_width 
    360#Graphics.width - 100 
  end 
  #-------------------------------------------------------------------------- 
  # ● 获取列数 
  #-------------------------------------------------------------------------- 
  def col_max 
    return 4 
  end 
  #-------------------------------------------------------------------------- 
  # ● 更新画面 
  #-------------------------------------------------------------------------- 
  def update 
    super 
    @item_window.category = current_symbol if @item_window 
  end 
  #-------------------------------------------------------------------------- 
  # ● 生成指令列表 
  #-------------------------------------------------------------------------- 
  def make_command_list 
    add_command(Vocab::item,     :item) 
    add_command(Vocab::weapon,   :weapon) 
    add_command(Vocab::armor,    :armor) 
    add_command(Vocab::key_item, :key_item) 
  end 
  #-------------------------------------------------------------------------- 
  # ● 设置物品窗口 
  #-------------------------------------------------------------------------- 
  def item_window=(item_window) 
    @item_window = item_window 
    update 
  end 
end 
 |