Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Sign in to follow this  
Polraudio

Screen Resolution + Map Size?

Question

Im using this screen resolution script to change it to 720p resolution and im having troubles with the map fitting the resolution.

Im aware of the resolution script that stretches instead of changing and i dont want it.

Here is what it looks like if you were to use the script.

720p.png

 

#==============================================================================
# ■ Win32API
#------------------------------------------------------------------------------
# by Squall squall@loeher.znn.com
# Change the window size
# I must thank cybersam for his mouse and keyboard scripts. they were very
# useful finding some winapi function.
#
# !! this script MUST be on top of all other or the game will crash,
#    if you use scripts to enlarge maps!
#==============================================================================

class Win32API
#--------------------------------------------------------------------------
# - define constant
#--------------------------------------------------------------------------
GAME_INI_FILE = ".\\Game.ini"         # define "Game.ini" file
HWND_TOPMOST = 0                      # window always active
HWND_TOP = -1                         # window active when used only
SWP_NOMOVE   = 0                      # window pos and sizes can be changed
#--------------------------------------------------------------------------
# - Win32API.GetPrivateProfileString // check your game 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 // find 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 // change window positions and sizes
#--------------------------------------------------------------------------
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, 240, 240, w + 6, h + 32, 0)

  #the line below makes the window on top of all others
  #win = swp.call(hWnd, HWND_TOPMOST, 0, 0, w + 6, h + 32, SWP_NOMOVE)
  return win
end
#--------------------------------------------------------------------------
# - Win32API.client_size // check the window 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

#==============================================================================
# - proceed with creation of the window
#------------------------------------------------------------------------------
# the width and height variables set the screen size.
#==============================================================================
$width = 1280
$height = 720
win = Win32API.SetWindowPos($width, $height)
if(win == 0)
  p "Size change has failed!"
end

 

I tried editing viewports in the Spriteset_Map but had nothing but fail.

 

What scripts would i need to change and what parts in order to see the map all the way and do scrolling correctly?

 

Thanks in advance.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I looked around but couldn't find the source of the script or any solutions to the issue.

 

Wherever you got it from should have a demo, right? You should see what they did with the script in that demo. Or ask the author.

Share this post


Link to post
Share on other sites
  • 0

I reado somewere ages ago on some website, this persong managed to get a larger window and have the game fit in the window BUT... unfortunately, they could only manage to stretch the game to fit the window and not actually allow it more space

Share this post


Link to post
Share on other sites
  • 0

there is not demo for the script. I wish there was.

 

I tried other sites and no one knows how to do it.

 

Guess i will just have to suffer.

 

Thanks anyways.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...