12-17-2012, 09:28 PM
I've changed around a lot of this script in the version in my project, so the only real recommendation I can give is to find CENTER_X and replace the block of code there. I'm using the SDK version, but it's between the changes to Spriteset_Map and Game_Map in one of the scripts.
... aha, I think this is the original block of code:
... aha, I think this is the original block of code:
PHP Code:
<?php
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
# This class handles the player. Its functions include event starting
# determinants and map scrolling. Refer to "$game_player" for the one
# instance of this class.
#------------------------------------------------------------------------------
# This has been edited define the actual center of the screen
#==============================================================================
class Game_Player
#--------------------------------------------------------------------------
# * Invariables
#--------------------------------------------------------------------------
def CENTER_X
(Game_Window.width/2 - 16) * 4 # Center screen x-coordinate * 4
end
def CENTER_Y
(Game_Window.height/2 - 16) * 4 # Center screen y-coordinate * 4
end
#--------------------------------------------------------------------------
# * Set Map Display Position to Center of Screen
#--------------------------------------------------------------------------
def center(x, y)
max_x = ($game_map.width - Game_Window.width/32) * 128
max_y = ($game_map.height - Game_Window.height/32) * 128
$game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max
$game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max
end
end
However I've also noticed recently that I've been getting an overflow - I assume with my edit - the screen overestimates the right edge of the map, causing it to scroll one column of tiles too far. I haven't been worrying about this so far because I don't want to have the player ever near the edge of the screen, but... you might, so yeah.