2 hours ago(This post was last modified: 2 hours ago by DerVVulfman.)
Graphic Resize your Maps Version: 1
Introduction
This code is specific for those that code with, or adapting projects from, RPGMaker XP and VX to use the HiddenChest executable. It allows the field map of the project to take advantage of the built-in Graphics screen resize capability.
This is an innate feature of RPGMaker VXAce, so no script for Ace is included. And these are more of a corrective snippet than full coded features.
Features
It uses the defined size of the Game.exe window to determine the viewport size
It uses the defined size of the Game.exe window to determine how many tile across or down for map scrolling
No need of a over-blown tilemap/resolution script combination to do this.
Does not affect maps created 'before' the Graphics.resize_screen command is called.
Screenshots
If you want an 800x600 map, just picture a map at that dimension.
Demo
Nah. Had one today. A bit too much pickle juice.
Script
XP Version
Code:
# Graphic Resize your Maps (XP version)
# by DerVVulfman
# V 1.0 - 2026-08-08
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles the map. It includes scrolling and passable determining
# functions. Refer to "$game_map" for the instance of this class.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Get current screen width
#--------------------------------------------------------------------------
def res_width
return Graphics.width
end
#--------------------------------------------------------------------------
# * Get current screen height
#--------------------------------------------------------------------------
def res_height
return Graphics.height
end
#--------------------------------------------------------------------------
# * Get current number of tiles across
#--------------------------------------------------------------------------
def res_tiles_across
return (Graphics.width / 32).to_i
end
#--------------------------------------------------------------------------
# * Get current number of tiles down
#--------------------------------------------------------------------------
def res_tiles_down
return (Graphics.height / 32).to_i
end
#--------------------------------------------------------------------------
# * Scroll Down
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_down(distance)
dn = res_tiles_down
@display_y = [@display_y + distance, (self.height - dn) * 128].min
end
#--------------------------------------------------------------------------
# * Scroll Right
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_right(distance)
rt = res_tiles_across
@display_x = [@display_x + distance, (self.width - rt) * 128].min
end
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc.
# It's used within the Scene_Map class.
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
#
# -----------------------------------------------------------------------
# Obtain Width/Height Parameters from Game_Map
w = $game_map.res_width
h = $game_map.res_height
# Make viewports
@viewport1 = Viewport.new(0, 0, w, h)
@viewport2 = Viewport.new(0, 0, w, h)
@viewport3 = Viewport.new(0, 0, w, h)
# -----------------------------------------------------------------------
@viewport2.z = 200
@viewport3.z = 5000
# Make tilemap
@tilemap = Tilemap.new(@viewport1)
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
for i in 0..6
autotile_name = $game_map.autotile_names[i]
@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
@tilemap.map_data = $game_map.data
@tilemap.priorities = $game_map.priorities
# Make panorama plane
@panorama = Plane.new(@viewport1)
@panorama.z = -1000
# Make fog plane
@fog = Plane.new(@viewport1)
@fog.z = 3000
# Make character sprites
@character_sprites = []
for i in $game_map.events.keys.sort
sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
@character_sprites.push(sprite)
end
@character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
# Make weather
@weather = RPG::Weather.new(@viewport1)
# Make picture sprites
@picture_sprites = []
for i in 1..50
@picture_sprites.push(Sprite_Picture.new(@viewport2,
$game_screen.pictures[i]))
end
# Make timer sprite
@timer_sprite = Sprite_Timer.new
# Frame update
update
end
end
VX Version
Code:
# Graphic Resize your Maps (VX version)
# by DerVVulfman
# V 1.0 - 2026-08-08
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
# This class handles maps. It includes scrolling and passage determination
# functions. The instance of this class is referenced by $game_map.
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# * Get current screen width
#--------------------------------------------------------------------------
def res_width
return Graphics.width
end
#--------------------------------------------------------------------------
# * Get current screen height
#--------------------------------------------------------------------------
def res_height
return Graphics.height
end
#--------------------------------------------------------------------------
# * Get current number of tiles across
#--------------------------------------------------------------------------
def res_tiles_across
return (Graphics.width / 32).to_i
end
#--------------------------------------------------------------------------
# * Get current number of tiles down
#--------------------------------------------------------------------------
def res_tiles_down
return (Graphics.height / 32).to_i
end
#==============================================================================
# ** Spriteset_Map
#------------------------------------------------------------------------------
# This class brings together map screen sprites, tilemaps, etc. It's used
# within the Scene_Map class.
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# * Create Viewport
#--------------------------------------------------------------------------
def create_viewports
#
# -----------------------------------------------------------------------
# Obtain Width/Height Parameters from Game_Map
w = $game_map.res_width
h = $game_map.res_height
# Make Viewports
@viewport1 = Viewport.new(0, 0, w, h)
@viewport2 = Viewport.new(0, 0, w, h)
@viewport3 = Viewport.new(0, 0, w, h)
# -----------------------------------------------------------------------
@viewport2.z = 50
@viewport3.z = 100
#
end
end
Instructions
Merely place below Scene_Debug and above Main.
Compatibility
It will rewrite modules within Game_Map and Spriteset_Map pertaining to map scrolling parameters and the creation of the viewport (the window dimensions everything is drawn). But that is to be expected.
It wasn't hard to write.
FAQ
This doesn't cover the Battlesystem, the Spriteset_Battle, nor the positioning of RPGMaker XP Actor Battlers (covered in Game_Actor 'screen_x' & 'screen_y'). That may be adjusted for personal tastes.
Terms and Conditions
Free for use, even in commercial projects. Just due credit is requested.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)