Window Menu Resolution

Started by Ronivan, February 08, 2015, 02:09:35 pm

Previous topic - Next topic

Ronivan

I'm using ForeverZer0 and KK20 Resolution script for RPG Maker XP, and it work as wonder, but it don't change the size of the Menus windows, and the most important is the Menu itself.
I was wondering if anyone have solved the problem of menu size resolution and make it fit a desired size. Its tha last issue I had with the size resolution script, so I would appreciate any help with it.

KK20

There really is no way to resize the windows accordingly so that it works with anyone and everyone's custom scripts. It's something you have to do on your own. If still using the default system windows and scenes, Drago did write this little thing up that centers the windows:
http://forum.chaos-project.com/index.php/topic,13781.0.html

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Ronivan

February 08, 2015, 02:30:54 pm #2 Last Edit: February 08, 2015, 02:52:23 pm by Ronivan
Thanks for the script, but unfortunately, it bugs with my battle system. Not the script of center menu itself, the Drago Core Engine that bugs with my actual battle system.

LiTTleDRAgo

you dont have to use Drago Core Engine if you use F0's & KK20 Custom Resolution / KK20 XPA Tilemap

Ronivan

I've tryed KK20 XPA Tilemap, which is a wonder by its own right, but it don't centered the window.
But thanks for the new tip.

KK20

Uh, yes it does. I just tried it right now. Drago's Adjust Menu Position without his Core Engine works fine with my XP Ace Tilemap.
Note that the script ONLY affects the default scenes. If using a custom battle system, you're going to need to adjust the drawing locations yourself.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Ronivan

Don't know what I'm doing wrong then. If I put menu centralization script, it says: This script needs at least Custom Resolution v0.96 or Drago - Core Engine v1.40
And I'm using XPA Tilemap. It just don't even start the game itself.


KK20

Are you going the XP Ace route or are you using vanilla XP?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

LiTTleDRAgo

Spoiler: ShowHide

#==============================================================================
# ** Drago - Core Engine (snap_to_bitmap)
# Version : --
# Contact : littledrago.blogspot.com / forum.chaos-project.com
#==============================================================================

module LiTTleDRAgo
  #-------------------------------------------------------------------------
  # * Constant
  #-------------------------------------------------------------------------
  VX           = defined?(Window_ActorCommand)
  VXA          = defined?(Window_BattleActor)
  RGSS1        = defined?(Hangup)
  RGSS2        = RUBY_VERSION == '1.8.1' && !RGSS1
  RGSS3        = RUBY_VERSION == '1.9.2'
  APPPATHDRAGO = "#{ENV['APPDATA']}/Drago/"
end

$imported ||= {}
#==============================================================================
# ** CoreDLL
#------------------------------------------------------------------------------

#==============================================================================
module CoreDLL
  #-------------------------------------------------------------------------
  # * Constant
  #-------------------------------------------------------------------------
  Rtlmemory_pi = Win32API.new('kernel32','RtlMoveMemory','pii','i')
  Rtlmemory_ip = Win32API.new('kernel32','RtlMoveMemory','ipi','i')
  #-------------------------------------------------------------------------
  # * Get the game window handle (specific to game)
  #-------------------------------------------------------------------------
  unless method_defined?(:hwnd)
    def hwnd
      @window_find ||= Win32API.new('user32', 'FindWindowEx', %w(l l p p), 'i')
      @game_window ||= @window_find.call(0,0,"RGSS Player",0)
      return @game_window
    end 
  end
  #-------------------------------------------------------------------------
  # * Get the Game Window's width and height
  #-------------------------------------------------------------------------
  unless method_defined?(:client_size)
    def client_size
      @window_c_rect ||= Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
      @window_c_rect.call(self.hwnd, (rect = [0, 0, 0, 0].pack('l4')))
      right, bottom = rect.unpack('l4')[2..3]
      return right, bottom
    end 
  end
  #--------------------------------------------------------------------------
  # * snap_to_bitmap
  #--------------------------------------------------------------------------
  unless method_defined?(:snap_to_bitmap)
    def snap_to_bitmap
      @getdc       ||= Win32API.new('user32','GetDC','i','i')
      @ccdc        ||= Win32API.new('gdi32','CreateCompatibleDC','i','i')
      @ccbitmap    ||= Win32API.new('gdi32','CreateCompatibleBitmap','iii','i')
      @deleteobject||= Win32API.new('gdi32','DeleteObject','i','i')
      @bitblt      ||= Win32API.new('gdi32','BitBlt','iiiiiiiii','i')
      @setdibits   ||= Win32API.new('gdi32','SetDIBits','iiiiipi','i')
      @getdibits   ||= Win32API.new('gdi32','GetDIBits','iiiiipi','i')
      @selectobject||= Win32API.new('gdi32','SelectObject','ii','i')
      bitmap = Bitmap.new((width = Graphics.width), (height = Graphics.height))
      info   = [40,width,height,1,32,0,0,0,0,0,0].pack('LllSSLLllLL')
      hDC    = @ccdc.call((dc = @getdc.call(hwnd)))
      hBM    = @ccbitmap.call(dc, width, height)
      @deleteobject.call(@selectobject.call(hDC, hBM))
      @setdibits.call(hDC, hBM, 0, height, (address = bitmap.address), info, 0)
      @bitblt.call(hDC, 0, 0, width, height, dc, 0, 0, 0xCC0020)
      @getdibits.call(hDC, hBM, 0, height, address, info, 0)
      @deleteobject.call(hBM)
      @deleteobject.call(hDC)
      bitmap
    end   
  end
end                       
LiTTleDRAgo.extend(CoreDLL)

#==============================================================================
# ** Graphics
#------------------------------------------------------------------------------
#  This module handles all Graphics
#==============================================================================
class << Graphics
  #--------------------------------------------------------------------------
  # ● Redefined method: width
  #--------------------------------------------------------------------------
  unless method_defined?(:width)
    def width
      LiTTleDRAgo.client_size.at(0)
    end
  end
  #--------------------------------------------------------------------------
  # ● Redefined method: height
  #--------------------------------------------------------------------------
  unless method_defined?(:height)
    def height
      LiTTleDRAgo.client_size.at(1)
    end
  end
  #--------------------------------------------------------------------------
  # ● Redefined method: snap_to_bitmap
  #--------------------------------------------------------------------------
  unless method_defined?(:snap_to_bitmap)
    def snap_to_bitmap
      LiTTleDRAgo.snap_to_bitmap
    end
  end
end
#==============================================================================
# ■ Bitmap
#------------------------------------------------------------------------------
#
#==============================================================================
class Bitmap 
  #----------------------------------------------------------------------------
  # ● Constant
  #----------------------------------------------------------------------------
  RtlMoveMemory_pi = CoreDLL::Rtlmemory_pi
  RtlMoveMemory_ip = CoreDLL::Rtlmemory_ip
  #----------------------------------------------------------------------------
  # ● New method: address
  #----------------------------------------------------------------------------
  unless method_defined?(:address)
    def address
      @address ||= (
        RtlMoveMemory_pi.call(a="\0"*4, __id__*2+16, 4)
        RtlMoveMemory_pi.call(a, a.unpack('L')[0]+8, 4)
        RtlMoveMemory_pi.call(a, a.unpack('L')[0]+16, 4)
        a.unpack('L')[0]
      )
    end
  end
end
#==============================================================================
# **                                               END OF Drago - Core Engine
#==============================================================================


put the script below XPA Tilemap