domingo, 31 de março de 2019

Use RPG Maker XP Characters in VX Ace

#===============================================================================
# Use RPG Maker XP Characters in VX ACE
#-------------------------------------------------------------------------------
# by Marcelo Amancio de Lima Santos (maxhero)
=begin
 Terms of Use:
  —If use don't forget to quote my name in credits.
  —You're free to modify and redistribute this script keeping this Header.
  Instructions:
  —To use a RPG Maker XP Character, add $[XP] before graphic name.
=end
#===============================================================================
module Cache
  def self.character(filename)
    main_bitmap   = load_bitmap("Graphics/Characters/", filename)
    if filename.include?("$[XP]")
      w     = (main_bitmap.width/4)*3
      h     = main_bitmap.height
      bmp   = Bitmap.new(w,h)
      bmp.blt(0, 0, main_bitmap, Rect.new((main_bitmap.width/4),0,w,h))
      return bmp
    else
      return main_bitmap
    end
  end
end