Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Game window proportions

I want to change the default game window proportions from 20x15 to 21x15, a small thing yes but it would make a big difference, also if anyone knows how to change the default new map size from 20x15 to 21x15 would be much obliged.
I KNOW it's possible cos someone told me SOMEONE has a game that does it...but i forgot who =(.
 
There's probably a resolution script somewhere that lets you change window sizes (in your case, to 672x480 pixels), try a forum search.

As for a default new map size, I don't think it's possible without modifying the editor itself, which is probably illegal. You'll just have to do with changing each new map to 21x15 when you create it.
 
i've found One resizer(well about 5 but they seem to do the same final thing)
what i want is something similar(same as what you said) but all the resizers i've seen extend the screen by 32 but then ALSO extend the map by 1 square Destroying the benifit, the screen still scrolls left and right as you go from side to side, but lopsidedly.
 
Moridin":2narda4e said:
Ok
This is the game without the script, there is one line of tiles off the left hand side of the screen
This is the game With the script, again there is STILL one line of tiles off the left side.

You want it to be centered, correct?

That requires an edit to the Game_Map and Game_Player classes.

In Game_Map, you need to edit the following bits of code:

Code:
  #--------------------------------------------------------------------------
  # * Scroll Down
  #     distance : scroll distance
  #--------------------------------------------------------------------------
  def scroll_down(distance)
    @display_y = [@display_y + distance, (self.height - 15) * 128].min
  end

so that the 15 right after self.height is the height of the screen, in tiles. You also need to edit (in Game_Map)

Code:
  #--------------------------------------------------------------------------
  # * Scroll Right
  #     distance : scroll distance
  #--------------------------------------------------------------------------
  def scroll_right(distance)
    @display_x = [@display_x + distance, (self.width - 20) * 128].min
  end

so that the 20 right after self.width is equal to the width of the screen, in tiles. Finally, in Game_Player, you need to edit :

Code:
  #--------------------------------------------------------------------------
  # * Set Map Display Position to Center of Screen
  #--------------------------------------------------------------------------
  def center(x, y)
    max_x = ($game_map.width - 20) * 128
    max_y = ($game_map.height - 15) * 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

in the same way as the two bits of code above.
 
Ok that helps but still doesnt fix it
um...here is the code im using if that helps
class Resolution
  def self.resize(width,height)
    getSystemMetrics = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')
    moveWindow = Win32API.new('user32','MoveWindow',['l','i','i','i','i','l'],'l')
    findWindowEx = Win32API.new('user32','FindWindowEx',['l','l','p','p'],'i')
    window = findWindowEx.call(0,0,"RGSS Player",0)
    screenwidth = getSystemMetrics.call(0)
    screenheight = getSystemMetrics.call(1)
    moveWindow.call(window,(screenwidth - width) / 2,(screenheight - height) / 2,width,height,1)
  end
end
 
I just figured out several of your problems. First, that black bar is because of the "viewports". Second, your window still isn't the proper size. Copy this into your project, with edits as necessary where I've already said you should, as well as the total resolution added to the viewports as necessary. (Although the first one in Spriteset_Battle should have the height left alone)

Code:
class Resolution
  def self.resize(width,height)
    getSystemMetrics = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')
    moveWindow = Win32API.new('user32','MoveWindow',['l','i','i','i','i','l'],'l')
    findWindowEx = Win32API.new('user32','FindWindowEx',['l','l','p','p'],'i')
    window = findWindowEx.call(0,0,"RGSS Player",0)
    screenwidth = getSystemMetrics.call(0)
    screenheight = getSystemMetrics.call(1)
    windowwidth = width + 6
    windowheight = height + 32
    moveWindow.call(window,(screenwidth - windowwidth) / 2,(screenheight - windowheight) / 2,windowwidth,windowheight,1) 
  end
end

#==============================================================================
# ** 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
  #--------------------------------------------------------------------------
  # * Scroll Down
  #     distance : scroll distance
  #--------------------------------------------------------------------------
  def scroll_down(distance)
    @display_y = [@display_y + distance, (self.height - 15) * 128].min
  end
  #--------------------------------------------------------------------------
  # * Scroll Right
  #     distance : scroll distance
  #--------------------------------------------------------------------------
  def scroll_right(distance)
    @display_x = [@display_x + distance, (self.width - 21) * 128].min
  end
end

#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # * Invariables
  #--------------------------------------------------------------------------
  CENTER_X = (352 - 16) * 4   # Center screen x-coordinate * 4
  CENTER_Y = (240 - 16) * 4   # Center screen y-coordinate * 4
  #--------------------------------------------------------------------------
  # * Set Map Display Position to Center of Screen
  #--------------------------------------------------------------------------
  def center(x, y)
    max_x = ($game_map.width - 20) * 128
    max_y = ($game_map.height - 15) * 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

#==============================================================================
# ** 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
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 672, 480)
    @viewport2 = Viewport.new(0, 0, 672, 480)
    @viewport3 = Viewport.new(0, 0, 672, 480)
    @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

#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
#  This class brings together battle screen sprites. It's used within
#  the Scene_Battle class.
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias old_init initialize
  def initialize
    ild_init
    # Make viewports
    @viewport1 = Viewport.new(0, 0, 672, 320)
    @viewport2 = Viewport.new(0, 0, 672, 480)
    @viewport3 = Viewport.new(0, 0, 672, 480)
    @viewport4 = Viewport.new(0, 0, 672, 480)
    @viewport2.z = 101
    @viewport3.z = 200
    @viewport4.z = 5000
    # Make battleback sprite
    @battleback_sprite = Sprite.new(@viewport1)
    # Make enemy sprites
    @enemy_sprites = []
    for enemy in $game_troop.enemies.reverse
      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
    end
    # Make actor sprites
    @actor_sprites = []
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    # Make weather
    @weather = RPG::Weather.new(@viewport1)
    # Make picture sprites
    @picture_sprites = []
    for i in 51..100
      @picture_sprites.push(Sprite_Picture.new(@viewport3,
        $game_screen.pictures[i]))
    end
    # Make timer sprite
    @timer_sprite = Sprite_Timer.new
    # Frame update
    update
  end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top