class Window_Pictures< Window_Base #-------------------------------------------------------------------------- # ● 实例变量 #-------------------------------------------------------------------------- attr_accessor :sprite, :bitmap #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- def initialize super(-64, -64, 64, 64) self.contents = Bitmap.new(width - 32, height - 32) @sprite = Sprite.new @bitmap = RPG::Cache.pictures("文件名") refresh end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh draw_pictures(160,360) end #-------------------------------------------------------------------------- # ● 绘制精灵 #-------------------------------------------------------------------------- def draw_pictures(x, y) @sprite.x = x @sprite.y = y @sprite.bitmap = @bitmap end end
class Window_Pictures< Window_Base
#--------------------------------------------------------------------------
# ● 实例变量
#--------------------------------------------------------------------------
attr_accessor :sprite, :bitmap
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(-64, -64, 64, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@sprite = Sprite.new
@bitmap = RPG::Cache.pictures("文件名")
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
draw_pictures(160,360)
end
#--------------------------------------------------------------------------
# ● 绘制精灵
#--------------------------------------------------------------------------
def draw_pictures(x, y)
@sprite.x = x
@sprite.y = y
@sprite.bitmap = @bitmap
end
end
未测试 |