本帖最后由 骷髅岛遗老 于 2017-9-8 20:06 编辑 RUBY 代码复制#encoding:utf-8#==============================================================================# ■ 装备说明增强#--- ...
class Window_Help < Window_Base def initialize(line_number = 0) if SceneManager.scene_is?(Scene_Battle) line_number = 2 super(0, 0, Graphics.width, fitting_height(line_number)) else super(0, 0, 210, fitting_height(line_number)) self.z = 150 contents.font.size = 14 hide end end def uppos(index,rect,window) if SceneManager.scene_is?(Scene_Battle) return else self.height = fitting_height2(Help.getline(@xtext,13)) create_contents contents.font.size = 14 rect.x -= window.ox rect.y -= window.oy ax = rect.x + rect.width + 10 ax = rect.x - self.width + 10 if ax + self.width > window.width + 10 ax += window.x ax = 0 if ax < 0 ay = rect.y + rect.height ay = rect.y - self.height if ay + self.height > window.height ay += window.y ay = 0 if ay < 0 self.x = ax self.y = ay set_text(@xtext) show end end def set_item(item) if SceneManager.scene_is?(Scene_Battle) set_text(item ? item.description : "") else if item == nil set_text("") return end @xtext = "" @xtext = "名称:" + item.name + "\n" @xtext += "介绍:" + item.description + "\n" @xtext += "价格:" + item.price.to_s + "\n" if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item) @xtext += Help.getequiphelp(item) if item.is_a?(RPG::EquipItem) @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n" end end def refresh if SceneManager.scene_is?(Scene_Battle) contents.clear draw_text_ex(4, 0, @text) else contents.clear hide if @text == "" draw_text_ex(4, 0, @text,width,40,false) end endend
class Window_Help < Window_Base def initialize(line_number = 0) if SceneManager.scene_is?(Scene_Battle) line_number = 2 super(0, 0, Graphics.width, fitting_height(line_number)) else super(0, 0, 210, fitting_height(line_number)) self.z = 150 contents.font.size = 14 hide end end def uppos(index,rect,window) if SceneManager.scene_is?(Scene_Battle) return else self.height = fitting_height2(Help.getline(@xtext,13)) create_contents contents.font.size = 14 rect.x -= window.ox rect.y -= window.oy ax = rect.x + rect.width + 10 ax = rect.x - self.width + 10 if ax + self.width > window.width + 10 ax += window.x ax = 0 if ax < 0 ay = rect.y + rect.height ay = rect.y - self.height if ay + self.height > window.height ay += window.y ay = 0 if ay < 0 self.x = ax self.y = ay set_text(@xtext) show end end def set_item(item) if SceneManager.scene_is?(Scene_Battle) set_text(item ? item.description : "") else if item == nil set_text("") return end @xtext = "" @xtext = "名称:" + item.name + "\n" @xtext += "介绍:" + item.description + "\n" @xtext += "价格:" + item.price.to_s + "\n" if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item) @xtext += Help.getequiphelp(item) if item.is_a?(RPG::EquipItem) @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n" end end def refresh if SceneManager.scene_is?(Scene_Battle) contents.clear draw_text_ex(4, 0, @text) else contents.clear hide if @text == "" draw_text_ex(4, 0, @text,width,40,false) end end end
折叠内容标题(非必须)
折叠内容
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-11-17 16:41
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.