本帖最后由 qq634488405 于 2024-2-29 16:38 编辑 使用window_item时 RUBY 代码复制
window_item修改 RUBY 代码复制
技能消耗同理 |
契约师Vi 发表于 2024-2-25 00:21 class Window_BattleItemNum < Window_Base def initialize super(140+350, 290+96+12, 640-140-350-30, 160-96-12) #super(0, 0, 640, 480) self.contents = Bitmap.new(width , height) @item = nil self.opacity = 255 refresh end #-------------------------------------------------------------------------- # ● 获取物品 #-------------------------------------------------------------------------- def item return @data[self.index] end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh self.contents.clear if @item == nil return end case @item when RPG::Item number = $game_party.item_number(@item.id) when RPG::Weapon number = $game_party.weapon_number(@item.id) when RPG::Armor number = $game_party.armor_number(@item.id) end self.contents.font.color = system_color self.contents.draw_text(4 , 2-8, 204, 32, "剩余:", 0) self.contents.font.color = normal_color self.contents.draw_text(30, 2-8, 120, 32, number.to_s, 2) if @item.is_a?(RPG::Item) return end end #-------------------------------------------------------------------------- # ● 设置物品 # item : 新的物品 #-------------------------------------------------------------------------- def item=(item) if @item != item @item = item refresh end end end 大佬你看下这个该如何改。我怎么弄都不显示东西 |
|
请求大佬帮助啊 |
就像上边这样的,技能消耗消耗和剩余数量如何单独显示 |
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-24 12:16
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.