Save-Point
Basic Width and Height - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: Basic Width and Height (/thread-7505.html)



Basic Width and Height - kyonides - 06-26-2019

Basic Width and Height
"Scripting Tool"

This snippet or scriptlet should be placed above Main and any other custom script that might depend on the window width and height. The scriptlet should detect which version of RGSS you are currently running so you can safely play XP or VX games. VX Ace does not need this.

Code:
unless Graphics.respond_to?(:width)

module Graphics
  found = Object.constants.respond_to?('Sound')
  @width = found ? 544 : 640
  @height = found ? 416 : 480
  def self.width
    @width
  end

  def self.height
    @height
  end
end

module RPG::Cache
  def self.face(name)
    load_bitmap('Graphics/Faces/', name).dup
  end
end

end

Terms

You should not credit me for this simple snippet. Use it as much as you need to or simply ignore it. Laughing + Tongue sticking out