• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Resolution and Window Size Demo

Would you actually use this in a game?

  • Definitely!

    Votes: 14 100.0%
  • Why? I don't want it...

    Votes: 0 0.0%

  • Total voters
    14

rm2kdude

Advanced Pixel-Artist
358
Posts
19
Years
  • Age 34
  • usa
  • Seen Oct 30, 2022
A modification, this will allow you to have full windows showing, but mess around with the font settings, you'll get it right.
Code:
#================================================================
#BEGIN CLASS
#================================================================
#Script made by Squall [email protected]
#================================================================
begin
class Win32API
  #==============================================================
  #CONSTANTS
  #==============================================================
  SCREEN_WIDTH = 320
  SCREEN_HEIGHT = 240
  GAME_INI_FILE = ".\\Game.ini"         # define "Game.ini" file
  HWND_TOPMOST = 0                      # window always active
  HWND_TOP = 0                         # window active when used only
  SWP_NOMOVE   = 0                      # window pos and sizes can be changed
  #==============================================================
  #Win32API.GetPrivateProfileString
  #==============================================================
  #Checks your game's title in Game.ini
  def Win32API.GetPrivateProfileString(section, key)
    val = "\0"*256
    gps = Win32API.new('kernel32', 'GetPrivateProfileString',%w(p p p p l p), 'l')
    gps.call(section, key, "", val, 256, GAME_INI_FILE)
    val.delete!("\0")
    return val
  end
  #==============================================================
  #Win32API.FindWindow
  #==============================================================
  #Finds the RGSS Window
  def Win32API.FindWindow(class_name, title)
    fw = Win32API.new('user32', 'FindWindow', %(p, p), 'i')
    hWnd = fw.call(class_name, title)
    return hWnd
  end
  #==============================================================
  #Win32API.SetWindowPos
  #==============================================================
  #Changes Window position and size
  def Win32API.SetWindowPos(w, h)
    title =  Win32API.GetPrivateProfileString("Game", "Title")
    hWnd = Win32API.FindWindow("RGSS Player", title)
    swp = Win32API.new('user32', 'SetWindowPos', %(l, l, i, i, i, i, i), 'i')
    win = swp.call(hWnd, HWND_TOP, 0, 0, w + 6, h + 26, 0)
    #the line below makes the window on top of all others
    win = swp.call(hWnd, HWND_TOPMOST, 0, 0, w + 6, h + 26, SWP_NOMOVE)
    return win
  end
  #==============================================================
  #Win32API.client_size
  #==============================================================
  #Checks the Window's width and height
  def Win32API.client_size
    title =  Win32API.GetPrivateProfileString("Game", "Title")
    hWnd = Win32API.FindWindow("RGSS Player", title)
    rect = [0, 0, 0, 0].pack('l4')
    Win32API.new('user32', 'GetClientRect', %w(l p), 'i').call(hWnd, rect)
    width, height = rect.unpack('l4')[2..3]
    return width, height
  end
#================================================================
#END CLASS
#================================================================
end

  #==============================================================
  #Win32API.client_size
  #==============================================================
  #The width and height variables set the screen size.
  win = Win32API.SetWindowPos(320, 246)
  if(win == 0)
    p "Size change has failed!"
  end
end
 

rm2kdude

Advanced Pixel-Artist
358
Posts
19
Years
  • Age 34
  • usa
  • Seen Oct 30, 2022
Ok, just got a new computer and well... I dunno what to say, I can't get the screen 320X240.. it's like the resolution zooms itself.

By default it goes to 800X600, I tried setting it to my laptops screen size and well... I can't see the bottom window of the game screen, it's like it's zoomed in.

I'm Using Windows Vista Home Premium.
 
Back
Top