本帖最后由 【蛋塔】 于 2016-10-3 07:09 编辑 我将Window_Base 312行改成: RUBY 代码复制def draw_icon_name(item, x, y) if item == nil &n ...
【蛋塔】 发表于 2016-10-3 13:57 可能我表达的不好,我想请教的是“光标的XY坐标”怎么改?如上图这种效果,因为装备的位置不是排成一排 ...
class Window_Selectable1<Window_Selectable #-------------------------------------------------------------------------- # ● 更新光标矩形 #-------------------------------------------------------------------------- def update_cursor_rect super() # 计算光标的x,y,宽度 x,y,cursor_width=[[85,0,90],[85,32,90],[0,32*2,90],[185,32*2,90], [85,32*3,125]][@index] # 更新光标矩形 self.cursor_rect.set(x, y, cursor_width, 32) endend#==============================================================================# ■ Window_EquipRight#------------------------------------------------------------------------------# 装备画面、显示角色现在装备的物品的窗口。#==============================================================================class Window_EquipRight< Window_Selectable1 #-------------------------------------------------------------------------- # ● 初始化对像 # actor : 角色 #-------------------------------------------------------------------------- def initialize(actor) super(272, 64, 368, 192) self.contents = Bitmap.new(width - 32, height - 32) @actor = actor refresh self.index = 0 end #-------------------------------------------------------------------------- # ● 获取物品 #-------------------------------------------------------------------------- def item return @data[self.index] end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear @data = [] @data.push($data_weapons[@actor.weapon_id]) @data.push($data_armors[@actor.armor1_id]) @data.push($data_armors[@actor.armor2_id]) @data.push($data_armors[@actor.armor3_id]) @data.push($data_armors[@actor.armor4_id]) @item_max = @data.size self.contents.font.color = system_color draw_item_name(@data[0], 92, 32 * 0) draw_item_name(@data[1], 92, 32 * 1) draw_item_name(@data[2], 4, 32 * 2) draw_item_name(@data[3], 192, 32 * 2) draw_item_name(@data[4], 92, 32 * 3) end #-------------------------------------------------------------------------- # ● 刷新帮助文本 #-------------------------------------------------------------------------- def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) endend
class Window_Selectable1<Window_Selectable #-------------------------------------------------------------------------- # ● 更新光标矩形 #-------------------------------------------------------------------------- def update_cursor_rect super() # 计算光标的x,y,宽度 x,y,cursor_width=[[85,0,90],[85,32,90],[0,32*2,90],[185,32*2,90], [85,32*3,125]][@index] # 更新光标矩形 self.cursor_rect.set(x, y, cursor_width, 32) end end #============================================================================== # ■ Window_EquipRight #------------------------------------------------------------------------------ # 装备画面、显示角色现在装备的物品的窗口。 #============================================================================== class Window_EquipRight< Window_Selectable1 #-------------------------------------------------------------------------- # ● 初始化对像 # actor : 角色 #-------------------------------------------------------------------------- def initialize(actor) super(272, 64, 368, 192) self.contents = Bitmap.new(width - 32, height - 32) @actor = actor refresh self.index = 0 end #-------------------------------------------------------------------------- # ● 获取物品 #-------------------------------------------------------------------------- def item return @data[self.index] end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear @data = [] @data.push($data_weapons[@actor.weapon_id]) @data.push($data_armors[@actor.armor1_id]) @data.push($data_armors[@actor.armor2_id]) @data.push($data_armors[@actor.armor3_id]) @data.push($data_armors[@actor.armor4_id]) @item_max = @data.size self.contents.font.color = system_color draw_item_name(@data[0], 92, 32 * 0) draw_item_name(@data[1], 92, 32 * 1) draw_item_name(@data[2], 4, 32 * 2) draw_item_name(@data[3], 192, 32 * 2) draw_item_name(@data[4], 92, 32 * 3) end #-------------------------------------------------------------------------- # ● 刷新帮助文本 #-------------------------------------------------------------------------- def update_help @help_window.set_text(self.item == nil ? "" : self.item.description) end end
查看全部评分
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2025-2-20 17:16
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.