设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 6515|回复: 8
打印 上一主题 下一主题

[已经解决] 求一个可以改分辨率的脚本(VX Ace的)

[复制链接]

Lv1.梦旅人

梦石
0
星屑
35
在线时间
1 小时
注册时间
2019-3-30
帖子
2
跳转到指定楼层
1
发表于 2019-3-31 12:18:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
因为游戏地图比较大,但是RPGmaker默认的分辨太小了,所以不方便,谢谢了。

Lv5.捕梦者 (版主)

梦石
1
星屑
23963
在线时间
3338 小时
注册时间
2011-7-8
帖子
3925

开拓者

2
发表于 2019-3-31 13:56:38 | 只看该作者
直接用rgd吧
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
565
在线时间
87 小时
注册时间
2015-6-7
帖子
68
3
发表于 2019-3-31 14:06:31 | 只看该作者
脚本里直接加条这个就行
Graphics.resize_screen(640, 480)
VA默认是544*416,这条最大也就改到640*480
更大的就需要改dll了
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
428
在线时间
50 小时
注册时间
2017-1-10
帖子
28
4
发表于 2019-4-3 09:49:09 | 只看该作者
在676行改分辨率,现在是800.600,兼容性最好

  1. #=============================================================================
  2. # Σ Fullscreen
  3. #-----------------------------------------------------------------------------
  4. # @author  : Gabriel "Gab!" Teles
  5. # @date    : 2014-09-27
  6. # @version : 0.9.2
  7. #-----------------------------------------------------------------------------
  8. # TODO:
  9. #   - Transições por imagens
  10. #-----------------------------------------------------------------------------
  11. # Créditos:
  12. #   Scripter Desconhecido no Pastebin (http://pastebin.com/sM2MNJZj)
  13. #   Esrever : Map viewport/scroll fix
  14. #   Zeus81  : FPS Display
  15. #-----------------------------------------------------------------------------
  16. # Permite utilizar fullscreen real (sem redimensionamento de tela), e alterar
  17. # o limite da função Graphics.resize_screen para a resolução máxima do monitor
  18. # ou um valor próximo.
  19. #=============================================================================

  20. # Módulo Graphics
  21. class << Graphics
  22.   # API
  23.   User32   = DL.dlopen('user32')
  24.   Kernel32 = DL.dlopen('kernel32')
  25.   GetActiveWindow  = DL::CFunc.new(  User32['GetActiveWindow' ], DL::TYPE_LONG)
  26.   GetSystemMetrics = DL::CFunc.new(  User32['GetSystemMetrics'], DL::TYPE_LONG)
  27.   GetWindowRect    = DL::CFunc.new(  User32['GetWindowRect'   ], DL::TYPE_LONG)
  28.   SetWindowLong    = DL::CFunc.new(  User32['SetWindowLong'   ], DL::TYPE_LONG)
  29.   SetWindowPos     = DL::CFunc.new(  User32['SetWindowPos'    ], DL::TYPE_LONG)
  30.   GetModuleHandle  = DL::CFunc.new(Kernel32['GetModuleHandle' ], DL::TYPE_LONG)  

  31.   # DLL sendo utilizada
  32.   _DLLName = DL::CPtr.malloc(140)
  33.   s = DL::CFunc.new(Kernel32['GetPrivateProfileString'], DL::TYPE_LONG).call([
  34.     DL::CPtr["Game"].to_i,
  35.     DL::CPtr["Library"].to_i,
  36.     0,
  37.     _DLLName.to_i,
  38.     140,
  39.     DL::CPtr["./Game.ini"].to_i
  40.   ])

  41.   @@DLLName = File.basename(_DLLName.to_s(s))

  42.   # Verifica se é uma RGSS3xx.dll
  43.   if @@DLLName.match(/^RGSS3(\d{2})\.dll$/)
  44.     @@DLLVersion = $1.to_i
  45.    
  46.     # Verifica se a versão é 0 ou 1.
  47.     if @@DLLVersion.between?(0, 1)
  48.       # Flag de fullscreen
  49.       @@inFullscreen = false
  50.      
  51.       # Instância da DLL. *Necessariamente* a RGSS300.dll ou RGSS301.dll, visto
  52.       # que o trabalho com memória a seguir é específico.
  53.      
  54.       @@DLLHandle   = GetModuleHandle.call([DL::CPtr[@@DLLName].to_i])
  55.      
  56.       # Instância da janela de jogo
  57.       @@hWnd       = GetActiveWindow.call([])
  58.      
  59.       # Tamanho da tela
  60.       @@screenSize = [
  61.         GetSystemMetrics.call([0]),
  62.         GetSystemMetrics.call([1])
  63.       ]
  64.      
  65.       # Calcula o próximo tamanho divisível por 32 para fazer a limitação
  66.       width, height = @@screenSize
  67.       width  += (32 - (width  % 32)) unless (width  % 32).zero?
  68.       height += (32 - (height % 32)) unless (height % 32).zero?
  69.       puts "Limitando para: #{width}x#{height}" if $TEST
  70.      
  71.       #-----------------------------------------------------------------------
  72.       # Bruxaria de scripter desconhecido. Remove a limitação de tamanho para
  73.       # o método Graphics.resize_screen (640x480)
  74.       #
  75.       # Base retirada de: http://pastebin.com/sM2MNJZj
  76.       #
  77.       # Adaptações para a RGSS300.dll e início do mapeamento dos endereços
  78.       # utilizados por Gab!
  79.       #-----------------------------------------------------------------------
  80.      
  81.       # Número para string
  82.       wh = ->(w, h, off = 0){
  83.         [w + off, h + off].pack('l2').scan(/..../)
  84.       }
  85.      
  86.       # Altera um valor na memória relativa à DLL
  87.       mod = ->(adr, val){
  88.         adr += @@OFF if @@DLLVersion.zero?
  89.         DL::CPtr.new(@@DLLHandle + adr)[0, val.size] = val
  90.       }
  91.      
  92.       # Valores úteis
  93.       wt,  ht  = width.divmod(32), height.divmod(32)
  94.       w,   h   = wh.(width, height)
  95.       ww,  hh  = wh.(width, height, 32)
  96.       www, hhh = wh.(wt.first, ht.first, 1)
  97.       zero     = [0].pack('l')
  98.          
  99.       # Faz as alterações na memória
  100.      
  101.       # Graphics
  102.       @@OFF = 0
  103.       mod.(0x195F, "\x90"*5) # ???
  104.       mod.(0x19A4,   h     ) # ???
  105.       mod.(0x19A9,   w     ) # ???
  106.       mod.(0x1A56,   h     ) # ???
  107.       mod.(0x1A5B,   w     ) # ???
  108.       mod.(0x20F6,   w     ) # Max width  (?)
  109.       mod.(0x20FF,   w     ) # Max width  (?)
  110.       mod.(0x2106,   h     ) # Max height (?)
  111.       mod.(0x210F,   h     ) # Max height (?)
  112.      
  113.       # Plane (?) Class
  114.       @@OFF   = -0xC0
  115.       Graphics::PlaneSpeedUp = true
  116.         # Setando para false não é necessário reescrever classe Plane. No
  117.         # entanto, o mapa fica MUITO lento.
  118.       mod.(0x1C5E3,  Graphics::PlaneSpeedUp ? zero : h) # Max height
  119.       mod.(0x1C5E8,  Graphics::PlaneSpeedUp ? zero : w) # Max width
  120.      
  121.       # ???
  122.       @@OFF = 0x20
  123.       mod.(0x1F477,  h     ) # ???
  124.       mod.(0x1F47C,  w     ) # ???
  125.      
  126.       # Tilemap Class
  127.       @@OFF = 0x1E0
  128.       mod.(0x211FF,  hh    ) # Tilemap render height
  129.       mod.(0x21204,  ww    ) # Tilemap render width
  130.       mod.(0x21D7D,  hhh[0]) # Tilemap max tiles on screen height
  131.       mod.(0x21E01,  www[0]) # Tilemap max tiles on screen width
  132.      
  133.       # ???
  134.       @@OFF = 0x140
  135.       mod.(0x10DEA8, h     ) # ???
  136.       mod.(0x10DEAD, w     ) # ???   
  137.       mod.(0x10DEDF, h     ) # ???
  138.       mod.(0x10DEE3, w     ) # ???
  139.       mod.(0x10DF14, h     ) # ???
  140.       mod.(0x10DF18, w     ) # ???
  141.       mod.(0x10DF48, h     ) # ???
  142.       mod.(0x10DF4C, w     ) # ???
  143.       mod.(0x10E6A7, w     ) # ???
  144.       mod.(0x10E6C3, h     ) # ???
  145.       mod.(0x10EEA9, w     ) # ???
  146.       mod.(0x10EEB9, h     ) # ???
  147.      
  148.       #-------------------------------------------------------------------------
  149.       # Fim da bruxaria
  150.       #-------------------------------------------------------------------------
  151.      
  152.       # Sprite de transição de tela
  153.       @@TransitionSprite = Sprite.new
  154.       @@TransitionSprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
  155.       @@TransitionSprite.bitmap.fill_rect(@@TransitionSprite.bitmap.rect, Color.new(0, 0, 0))
  156.       @@TransitionSprite.opacity = 0
  157.       @@TransitionSprite.z = 0x7FFFFFFF
  158.      
  159.       # Bitmap da tela no momento do Graphics.freeze
  160.       @@FrozenBitmap = Bitmap.new(Graphics.width, Graphics.height)
  161.       @@FrozenBitmap.fill_rect(@@FrozenBitmap.rect, Color.new(0, 0, 0))
  162.      
  163.       # Realiza a transição de tela
  164.       # Nota: Não é possível realizar transição de tela com imagens
  165.       alias oldFullscreenResTransition transition
  166.       def transition(time, image='', vague=40)
  167.         @@TransitionSprite.bitmap.dispose
  168.         @@TransitionSprite.dispose
  169.         @@TransitionSprite = Sprite.new
  170.         @@TransitionSprite.bitmap = @@FrozenBitmap
  171.         @@TransitionSprite.opacity = 255
  172.         @@TransitionSprite.z = 0x7FFFFFFF
  173.      
  174.         oldFullscreenResTransition(0)
  175.       
  176.         dec = (255.0 / time)
  177.         time.times {
  178.           @@TransitionSprite.opacity -= dec
  179.           Graphics.update
  180.         }
  181.       end
  182.      
  183.       # Fadein
  184.       def fadein(time)
  185.         @@FrozenBitmap = Bitmap.new(Graphics.width, Graphics.height)
  186.         @@FrozenBitmap.fill_rect(@@FrozenBitmap.rect, Color.new(0, 0, 0))
  187.       
  188.         transition(time)
  189.       end
  190.      
  191.       # Fadeout
  192.       def fadeout(time)
  193.         inc = (255.0 / time)
  194.         time.times {
  195.           @@TransitionSprite.opacity += inc
  196.           Graphics.update
  197.         }
  198.       end
  199.      
  200.       # Armazena a imagem da tela
  201.       alias oldFullscreenResFreeze freeze
  202.       def freeze(*a, &b)
  203.         oldFullscreenResFreeze(*a, &b)
  204.         @@FrozenBitmap = Graphics.snap_to_bitmap
  205.       end
  206.      
  207.       # Realiza o redimensionamento de tela
  208.       alias gabFullscreenOldResizeScreen resize_screen
  209.       def resize_screen(*a, &b)
  210.         # Redimensiona normalmente
  211.         gabFullscreenOldResizeScreen(*a, &b)
  212.         # Redimensiona o sprite de transição
  213.         @@TransitionSprite.bitmap.dispose
  214.         @@TransitionSprite.bitmap = Bitmap.new(*Graphics.size)
  215.         @@TransitionSprite.bitmap.fill_rect(@@TransitionSprite.bitmap.rect, Color.new(0, 0, 0))
  216.       
  217.         if Graphics::PlaneSpeedUp
  218.           # Manda o sinal de atualização para todas as instâncias da classe Plane
  219.           ObjectSpace.each_object(Plane){|plane|
  220.             plane.send(:recreateBitmap)
  221.           }
  222.         end
  223.       end
  224.      
  225.       # Altera para fullscreen
  226.       def fullscreen
  227.         # Retorna se já estiver em fullscreen
  228.         return if @@inFullscreen
  229.         # Tamanho antes do fullscreen
  230.         rect = DL::CPtr.malloc(16)
  231.         rect[0, 16] = 0.chr * 16
  232.         GetWindowRect.call([@@hWnd, rect])
  233.         @@windowSize = rect[0, 16].unpack("l*")
  234.         @@windowSize[2] -= @@windowSize[0]
  235.         @@windowSize[3] -= @@windowSize[1]
  236.         @@windowResolution = Graphics.size
  237.         # Muda o tamanho da tela
  238.         Graphics.resize_screen(*@@screenSize)
  239.         # Remover bordas da janela
  240.         SetWindowLong.call([@@hWnd, -16, 0x14000000])
  241.         # Coloca a janela acima de todas as outras
  242.         SetWindowPos.call([@@hWnd, -1, 0, 0, *@@screenSize, 0])
  243.         # Modifica a flag de fullscreen
  244.         @@inFullscreen = true
  245.         # Espera alguns frames para terminar o processamento
  246.         Graphics.wait(5)
  247.       end
  248.      
  249.       # Altera para modo janela
  250.       def windowed
  251.         # Retorna se não estiver em fullscreen
  252.         return unless @@inFullscreen
  253.         # Muda o tamanho da tela
  254.         Graphics.resize_screen(*@@windowResolution)
  255.         # Recoloca bordas da janela
  256.         SetWindowLong.call([@@hWnd, -16, 0x14CA0000])
  257.         # Coloca a janela na posição x,y,z comum e ajusta seu tamanho
  258.         SetWindowPos.call([@@hWnd, 0, *@@windowSize, 0])
  259.         # Modifica a flag de fullscreen
  260.         @@inFullscreen = false
  261.         # Espera alguns frames para terminar o processamento
  262.         Graphics.wait(5)
  263.       end
  264.      
  265.       # Tamanho da tela
  266.       def size
  267.         [self.width, self.height]
  268.       end
  269.      
  270.       # Verifica se a janela está no modo fullscreen
  271.       def fullscreen?
  272.         return @@inFullscreen
  273.       end
  274.      
  275.       # Verifica se a janela está no modo janela
  276.       def windowed?
  277.         return !@@inFullscreen
  278.       end
  279.      
  280.       # Alterna entre os modos fullscreen e janela
  281.       def toggleFullscreen
  282.         @@inFullscreen ? self.windowed : self.fullscreen
  283.       end
  284.     end
  285.   end
  286. end

  287. if Graphics::PlaneSpeedUp
  288.   # Remove a classe Plane Anterior
  289.   Object.send(:remove_const, :Plane)
  290.   # Redefinição da classe Plane
  291.   class Plane
  292.     attr_reader :viewport
  293.     attr_reader :bitmap
  294.     attr_reader :ox
  295.     attr_reader :oy
  296.     attr_reader :opacity
  297.     attr_reader :blend_type
  298.     attr_reader :color
  299.     attr_reader :tone
  300.     attr_reader :visible
  301.     attr_reader :zoom_x
  302.     attr_reader :zoom_y
  303.     attr_reader :z
  304.    
  305.     # Inicialização do objeto
  306.     def initialize(viewport = nil)
  307.       # É necessário verificar se um viewport foi enviado. Desse modo, ao mudar a
  308.       # resolução da tela, deve-se mudar também a rect do viewport para que o
  309.       # Plane que ocupava a tela toda continue
  310.       @defaultViewport = !viewport.is_a?(Viewport)
  311.       @viewport = @defaultViewport ? Viewport.new(0, 0, *Graphics.size) : viewport
  312.      
  313.       @sprite        = Sprite.new(@viewport)
  314.       @bitmap        = nil
  315.       @ox            = @sprite.ox         # 0
  316.       @oy            = @sprite.oy         # 0
  317.       @opacity       = @sprite.opacity    # 255
  318.       @blend_type    = @sprite.blend_type # 0
  319.       @color         = @sprite.color      # Color.new(0, 0, 0, 0)
  320.       @tone          = @sprite.tone       # Tone.new(0, 0, 0, 0)
  321.       @visible       = @sprite.visible    # true
  322.       @z             = @sprite.z          # 0
  323.       @zoom_x        = @sprite.zoom_x     # 1.0
  324.       @zoom_y        = @sprite.zoom_y     # 1.0
  325.     end
  326.    
  327.     def bitmap=(bitmap)
  328.       return unless bitmap.is_a?(Bitmap)
  329.       @bitmap = bitmap
  330.       self.recreateBitmap(true)
  331.     end
  332.    
  333.     def ox=(value)
  334.       @ox = value
  335.       return unless @bitmap
  336.       @sprite.ox = (value % @bitmap.width)
  337.     end
  338.    
  339.     def oy=(value)
  340.       @oy = value
  341.       return unless @bitmap
  342.       @sprite.oy = (value % @bitmap.height)
  343.     end
  344.    
  345.     def opacity=(value)
  346.       @sprite.opacity = value
  347.       @opacity = @sprite.opacity
  348.     end
  349.    
  350.     def blend_type=(value)
  351.       @sprite.blend_type = value
  352.       @blend_type = @sprite.blend_type
  353.     end
  354.    
  355.     def color=(value)
  356.       @sprite.color = value
  357.       @color = @sprite.color
  358.     end
  359.    
  360.     def tone=(value)
  361.       @sprite.tone = value
  362.       @tone = @sprite.tone
  363.     end
  364.    
  365.     def viewport=(value)
  366.       @defaultViewport &= (value == @sprite.viewport)
  367.       @sprite.viewport = value
  368.       @viewport = @sprite.viewport
  369.     end
  370.    
  371.     def visible=(value)
  372.       @sprite.visible = value
  373.       @visible = sprite.visible
  374.     end
  375.    
  376.     def z=(value)
  377.       @sprite.z = value
  378.       @z = @sprite.z
  379.     end
  380.    
  381.     def zoom_x=(value)
  382.       @sprite.zoom_x = value
  383.       @zoom_x = @sprite.zoom_x
  384.       self.recreateBitmap
  385.     end
  386.    
  387.     def zoom_y=(value)
  388.       @sprite.zoom_y = value
  389.       @zoom_y = @sprite.zoom_y
  390.       self.recreateBitmap
  391.     end
  392.    
  393.     def disposed?
  394.       return @sprite.disposed?
  395.     end
  396.    
  397.     def dispose
  398.       @sprite.dispose
  399.     end
  400.    
  401.     protected
  402.    
  403.     def recreateBitmap(forceRefresh = false)
  404.       cw, ch      = Graphics.width * (2.0/@zoom_x), Graphics.height * (2.0/@zoom_y)
  405.       needRefresh = true
  406.      
  407.       if @defaultViewport
  408.         @viewport.rect.width, @viewport.rect.height = *Graphics.size
  409.       end
  410.      
  411.       if @sprite.bitmap.nil? or @sprite.bitmap.disposed?
  412.         newBitmap = Bitmap.new(cw, ch)
  413.       else
  414.         if (cw == @sprite.bitmap.width) and (ch == @sprite.bitmap.height) and (!forceRefresh)
  415.           return
  416.         end
  417.       
  418.         newBitmap = Bitmap.new(cw, ch)
  419.         if (cw < @sprite.bitmap.width) and (ch < @sprite.bitmap.height)
  420.           newBitmap.blt(0, 0, @sprite.bitmap, @sprite.bitmap.rect)
  421.           @sprite.bitmap.dispose
  422.           needRefresh = false
  423.         end
  424.       end
  425.      
  426.       @sprite.bitmap = newBitmap
  427.       self.refreshBitmap if needRefresh or forceRefresh
  428.     end
  429.    
  430.     def refreshBitmap
  431.       # Limpa o bitmap
  432.       b = @sprite.bitmap
  433.       b.clear
  434.      
  435.       return if @bitmap.nil?
  436.      
  437.       # Quantia de espaços para blt
  438.       tx = (b.width  / @bitmap.width.to_f )
  439.       ty = (b.height / @bitmap.height.to_f)
  440.      
  441.       b.blt(0, 0, @bitmap, @bitmap.rect)
  442.      
  443.       return if tx + ty == 2
  444.      
  445.       # Preenche 1 linha
  446.       basePow = @bitmap.width
  447.       baseRct = Rect.new(0, 0, @bitmap.width, @bitmap.height)
  448.      
  449.       Math.log2(tx).floor.times{
  450.         b.blt(basePow, 0, b, baseRct)
  451.         baseRct.width += basePow
  452.         basePow *= 2
  453.       }
  454.      
  455.       # Último bitmap da linha
  456.       baseRct.width = (b.width - baseRct.width)
  457.       b.blt(basePow, 0, b, baseRct)
  458.      
  459.       # Preenche o restante das linhas
  460.       basePow = @bitmap.height
  461.       baseRct = Rect.new(0, 0, b.width, @bitmap.height)
  462.      
  463.       Math.log2(ty).floor.times{
  464.         b.blt(0, basePow, b, baseRct)
  465.         baseRct.height += basePow
  466.         basePow *= 2
  467.       }
  468.      
  469.       # Última linha
  470.       baseRct.height = b.height - baseRct.height
  471.       b.blt(basePow, 0, b, baseRct)
  472.     end
  473.   end
  474. end

  475. class Game_Map
  476.   # Número de tiles horizontais na tela
  477.   def screen_tile_x
  478.     (Graphics.width / 32.0).ceil
  479.   end

  480.   # Número de tiles verticais na tela
  481.   def screen_tile_y
  482.     (Graphics.height / 32.0).ceil
  483.   end
  484. end

  485. # Contador de FPS para o modo Fullscreen
  486. if $TEST
  487.   # FPS Display // Zeus81
  488.   # http://forums.rpgmakerweb.com/index.php?/topic/3738-fps-display-isnt-very-accurate/#entry40350
  489.   module Graphics
  490.     @fps, @fps_tmp = 0, []
  491.    
  492.     class << self
  493.       attr_reader :fps
  494.      
  495.       alias fps_update update unless method_defined?(:fps_update)
  496.       def update
  497.         t = Time.now
  498.         fps_update
  499.         @fps_tmp[frame_count % frame_rate] = Time.now != t
  500.         @fps = 0
  501.         frame_rate.times {|i| @fps += 1 if @fps_tmp[i]}
  502.         fps_sprite.src_rect.y = @fps * 16
  503.       end
  504.      
  505.       def fps_sprite
  506.         if !@fps_sprite or @fps_sprite.disposed?
  507.           @fps_sprite = Sprite.new
  508.           @fps_sprite.z = 0x7FFFFFFF
  509.           @fps_sprite.bitmap = Bitmap.new(24, 16*120)
  510.           @fps_sprite.bitmap.font.name = "Arial"
  511.           @fps_sprite.bitmap.font.size = 16
  512.           @fps_sprite.bitmap.font.color.set(255, 255, 255)
  513.           @fps_sprite.bitmap.fill_rect(@fps_sprite.bitmap.rect, Color.new(0, 0, 0, 127))
  514.           120.times {|i|
  515.             @fps_sprite.bitmap.draw_text(0, i*16, 24, 16, "% 3d"%i, 1)
  516.           }
  517.           @fps_sprite.src_rect.height = 16
  518.         end
  519.         return @fps_sprite
  520.       end      
  521.     end
  522.   end
  523. end

  524. #==============================================================================
  525. # ▼ Viewports/Map Fix for Modified RGSS300.dll File
  526. #   Origin of Code: Yanfly Engine Ace - Ace Core Engine v1.06
  527. # -- Last Updated: 2011.12.26
  528. # -- Level: Easy, Normal
  529. # -- Requires: n/a
  530. #==============================================================================

  531. #==============================================================================
  532. # ■ Game_Map
  533. #==============================================================================

  534. class Game_Map

  535.   #--------------------------------------------------------------------------
  536.   # overwrite method: scroll_down
  537.   #--------------------------------------------------------------------------
  538.   def scroll_down(distance)
  539.     if loop_vertical?
  540.       @display_y += distance
  541.       @display_y %= @map.height * 256
  542.       @parallax_y += distance
  543.     else
  544.       last_y = @display_y
  545.       dh = Graphics.height > height * 32 ? height : screen_tile_y
  546.       @display_y = [@display_y + distance, height - dh].min
  547.       @parallax_y += @display_y - last_y
  548.     end
  549.   end

  550.   #--------------------------------------------------------------------------
  551.   # overwrite method: scroll_right
  552.   #--------------------------------------------------------------------------
  553.   def scroll_right(distance)
  554.     if loop_horizontal?
  555.       @display_x += distance
  556.       @display_x %= @map.width * 256
  557.       @parallax_x += distance
  558.     else
  559.       last_x = @display_x
  560.       dw = Graphics.width > width * 32 ? width : screen_tile_x
  561.       @display_x = [@display_x + distance, width - dw].min
  562.       @parallax_x += @display_x - last_x
  563.     end
  564.   end

  565. end # Game_Map

  566. #==============================================================================
  567. # ■ Spriteset_Map
  568. #==============================================================================

  569. class Spriteset_Map

  570.   #--------------------------------------------------------------------------
  571.   # overwrite method: create_viewports
  572.   #--------------------------------------------------------------------------
  573.   def create_viewports
  574.     if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?
  575.       dx = (Graphics.width - $game_map.width * 32) / 2
  576.     else
  577.       dx = 0
  578.     end
  579.     dw = [Graphics.width, $game_map.width * 32].min
  580.     dw = Graphics.width if $game_map.loop_horizontal?
  581.     if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?
  582.       dy = (Graphics.height - $game_map.height * 32) / 2
  583.     else
  584.       dy = 0
  585.     end
  586.     dh = [Graphics.height, $game_map.height * 32].min
  587.     dh = Graphics.height if $game_map.loop_vertical?
  588.     @viewport1 = Viewport.new(dx, dy, dw, dh)
  589.     @viewport2 = Viewport.new(dx, dy, dw, dh)
  590.     @viewport3 = Viewport.new(dx, dy, dw, dh)
  591.     @viewport2.z = 50
  592.     @viewport3.z = 100
  593.   end

  594.   #--------------------------------------------------------------------------
  595.   # new method: update_viewport_sizes
  596.   #--------------------------------------------------------------------------
  597.   def update_viewport_sizes
  598.     if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?
  599.       dx = (Graphics.width - $game_map.width * 32) / 2
  600.     else
  601.       dx = 0
  602.     end
  603.     dw = [Graphics.width, $game_map.width * 32].min
  604.     dw = Graphics.width if $game_map.loop_horizontal?
  605.     if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?
  606.       dy = (Graphics.height - $game_map.height * 32) / 2
  607.     else
  608.       dy = 0
  609.     end
  610.     dh = [Graphics.height, $game_map.height * 32].min
  611.     dh = Graphics.height if $game_map.loop_vertical?
  612.     rect = Rect.new(dx, dy, dw, dh)
  613.     for viewport in [@viewport1, @viewport2, @viewport3]
  614.       viewport.rect = rect
  615.     end
  616.   end

  617. end # Spriteset_Map

  618. #==============================================================================
  619. # ■ Scene_Map
  620. #==============================================================================

  621. class Scene_Map < Scene_Base

  622.   #--------------------------------------------------------------------------
  623.   # alias method: post_transfer
  624.   #--------------------------------------------------------------------------
  625.   alias scene_map_post_transfer_ace post_transfer
  626.   def post_transfer
  627.     @spriteset.update_viewport_sizes
  628.     scene_map_post_transfer_ace
  629.   end

  630. end # Scene_Map

  631. #==============================================================================
  632. # ■ Game_Event
  633. #==============================================================================

  634. class Game_Event < Game_Character

  635.   #--------------------------------------------------------------------------
  636.   # overwrite method: near_the_screen?
  637.   #--------------------------------------------------------------------------
  638.   def near_the_screen?(dx = nil, dy = nil)
  639.     dx = [Graphics.width, $game_map.width * 256].min/32 - 5 if dx.nil?
  640.     dy = [Graphics.height, $game_map.height * 256].min/32 - 5 if dy.nil?
  641.     ax = $game_map.adjust_x(@real_x) - Graphics.width / 2 / 32
  642.     ay = $game_map.adjust_y(@real_y) - Graphics.height / 2 / 32
  643.     ax >= -dx && ax <= dx && ay >= -dy && ay <= dy
  644.   end

  645. end # Game_Event

  646. # Chama o método que realiza a mudança de tamanho
  647. # Graphics.fullscreen
  648. Graphics.resize_screen(800, 600)

  649. __END__
  650. # TESTES
  651. # Graphics.windowed
  652. x = Bitmap.new(50, 50)
  653. x.gradient_fill_rect(0,  0, 50, 25, Color.new(255, 0, 0), Color.new(0, 255, 0))
  654. x.gradient_fill_rect(0, 25, 50, 25, Color.new(0, 255, 0), Color.new(0, 0, 255))
  655. y = Plane.new
  656. y.bitmap = x
  657. y.zoom_x = 3
  658. y.zoom_y = 3
  659. #Graphics.fullscreen
  660. #Graphics.windowed
  661. loop do
  662.   Graphics.update
  663.   y.ox += 1
  664.   y.oy += 1
  665. end
复制代码
回复 支持 1 反对 0

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
35
在线时间
1 小时
注册时间
2019-3-30
帖子
2
5
 楼主| 发表于 2019-4-4 18:16:37 | 只看该作者
谢谢啦!
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1422
在线时间
245 小时
注册时间
2019-1-18
帖子
190
6
发表于 2019-4-4 18:47:56 | 只看该作者
#--------------------------------------------------------------------------
# ■ WindMesser 解像度640x480対応プロジェクト(VX Ace版) ver1.00
#--------------------------------------------------------------------------
#   作者:尘风
# URL:http://windmesser.tm.land.to/index.html
# MAIL:[email protected]
#------------------------------------------------------------------------------------------------------------------------------------------------
#概要:将RPGツクールVX Ace的分辨率变更为640×480。
#方法:标题、游戏结束、战斗时的背景图像自动放大。
#战斗背景是672 x512,
#除此之外,扩大到640×480。
#另外,战斗时敌人的初始位置会根据解析度进行修正。
#关于窗口表示也加入了若干的布局调整。
#
#使用条件:各素材的推荐图像尺寸如下。
#※必须使用过渡素材。
#
#・标题(Graphics/System/Titles1, Graphics/System/Titles2)
# 640x480
#・游戏结束(Graphics/System/GameOver.png)
# 640x480
#・战斗背景(Graphics/BattleBacks1, Graphics/BattleBacks2)
# 672 x512
#・变速箱(Graphics/System/BattleStart.png)
# 640x480
#
#使用方法:在脚本编辑器的“▼素材”以下插入
#------------------------------------------------------------------------------------------------------------------------------------------------
# ver1.00:窗口显示周围的布局调整
#扩展HP规格和项目名称表示领域,
#尽量不让窗口显得空荡荡的。
# # ver0.91:将战斗背景扩大成大一圈
#为了不扩大,将图像尺寸改为676x512。
# ver0.90:仅放大调整背景图像的简单版本
#--------------------------------------------------------------------------

#==============================================================================
# ▼ 内部仕様の定数
#==============================================================================

# 解像度640x480プロジェクト使用フラグ
# ※他スクリプト素材配布者様向けの判断用フラグ変数です
#   (Graphics.width, Graphics.height で判断する事もできます)
$VXA_640x480 = true

# VX Ace デフォルト解像度
$VXA_O_WIDTH = 544
$VXA_O_HEIGHT = 416

# 解像度を640x480に変更
Graphics.resize_screen(640, 480)

#==============================================================================
# ▼ 追加メソッド
#==============================================================================

class Sprite
  
  #--------------------------------------------------------------------------
  # ● スプライト拡大メソッド
  #    使用素材幅がデフォルト解像度に準拠していれば拡大
  #--------------------------------------------------------------------------
  def vxa_640x480_zoom(add_w = 0, add_h = 0)
   
    self.zoom_x = (Graphics.width + add_w) * 1.0 / width
    self.zoom_y = (Graphics.height + add_h) * 1.0 / height

  end
  
end

#==============================================================================
# ▼ プリセットスクリプト再定義1:画像拡大など
#==============================================================================

#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
#  タイトル画面の処理を行うクラスです。
#==============================================================================

class Scene_Title < Scene_Base
  
  if !method_defined?(:create_background_vga)
    alias create_background_vga create_background
  end
  
  #--------------------------------------------------------------------------
  # ● 背景の作成
  #--------------------------------------------------------------------------
  def create_background
    create_background_vga
   
    # タイトル画像の拡大
    @sprite1.vxa_640x480_zoom
    @sprite2.vxa_640x480_zoom

  end
  
end

#==============================================================================
# ■ Scene_Gameover
#------------------------------------------------------------------------------
#  ゲームオーバー画面の処理を行うクラスです。
#==============================================================================

class Scene_Gameover < Scene_Base
  
  if !method_defined?(:create_background_vga)
    alias create_background_vga create_background
  end

  #--------------------------------------------------------------------------
  # ● 背景の作成
  #--------------------------------------------------------------------------
  def create_background
    create_background_vga
   
    # ゲームオーバー画像の拡大
    @sprite.vxa_640x480_zoom
   
  end

end

#==============================================================================
# ■ Spriteset_Battle
#------------------------------------------------------------------------------
#  バトル画面のスプライトをまとめたクラスです。このクラスは Scene_Battle クラ
# スの内部で使用されます。
#==============================================================================

class Spriteset_Battle
  
  if !method_defined?(:create_battleback1_vga)
    alias create_battleback1_vga create_battleback1
    alias create_battleback2_vga create_battleback2
    alias create_enemies_vga create_enemies
  end

  #--------------------------------------------------------------------------
  # ● 戦闘背景(床)スプライトの作成
  #--------------------------------------------------------------------------
  def create_battleback1
    create_battleback1_vga
   
    # 戦闘背景の拡大
    @back1_sprite.vxa_640x480_zoom(36, 32)
   
  end
  #--------------------------------------------------------------------------
  # ● 戦闘背景(壁)スプライトの作成
  #--------------------------------------------------------------------------
  def create_battleback2
    create_battleback2_vga
   
    # 戦闘背景の拡大
    @back2_sprite.vxa_640x480_zoom(36, 32)
   
  end
  
end

#==============================================================================
# ■ Game_Troop
#------------------------------------------------------------------------------
#  敵グループおよび戦闘に関するデータを扱うクラスです。バトルイベントの処理も
# 行います。このクラスのインスタンスは $game_troop で参照されます。
#==============================================================================

class Game_Troop < Game_Unit
  
  if !method_defined?(:setup_vga)
    alias setup_vga setup
  end
  
  #--------------------------------------------------------------------------
  # ● セットアップ
  #--------------------------------------------------------------------------
  def setup(troop_id)
    setup_vga(troop_id)
   
    # トループ座標の修正
    @enemies.each do |enemy|
      enemy.screen_x = (enemy.screen_x * (Graphics.width * 1.0 / $VXA_O_WIDTH)).to_i
      enemy.screen_y = (enemy.screen_y * (Graphics.height * 1.0 / $VXA_O_HEIGHT)).to_i
    end
   
  end
  
end

#==============================================================================
# ▼ プリセットスクリプト再定義2:ウィンドウレイアウト調整など
#==============================================================================

#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
#  ゲーム中の全てのウィンドウのスーパークラスです。
#==============================================================================

class Window_Base < Window
  if !method_defined?(:draw_actor_name_vga)
    alias draw_actor_name_vga draw_actor_name
    alias draw_actor_class_vga draw_actor_class
    alias draw_actor_hp_vga draw_actor_hp
    alias draw_actor_mp_vga draw_actor_mp
    alias draw_actor_tp_vga draw_actor_tp
    alias draw_item_name_vga draw_item_name
  end
  
  #--------------------------------------------------------------------------
  # ● 名前の描画
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, x, y, width = 144)
    draw_actor_name_vga(actor, x, y, width)
  end
  #--------------------------------------------------------------------------
  # ● 職業の描画
  #--------------------------------------------------------------------------
  def draw_actor_class(actor, x, y, width = 144)
    draw_actor_class_vga(actor, x, y, width)
  end
  #--------------------------------------------------------------------------
  # ● HP の描画
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 188)
    draw_actor_hp_vga(actor, x, y, width)
  end
  #--------------------------------------------------------------------------
  # ● MP の描画
  #--------------------------------------------------------------------------
  def draw_actor_mp(actor, x, y, width = 188)
    draw_actor_mp_vga(actor, x, y, width)
  end
  #--------------------------------------------------------------------------
  # ● TP の描画
  #--------------------------------------------------------------------------
  def draw_actor_tp(actor, x, y, width = 188)
    draw_actor_tp_vga(actor, x, y, width)
  end
  #--------------------------------------------------------------------------
  # ● シンプルなステータスの描画
  #--------------------------------------------------------------------------
  def draw_actor_simple_status(actor, x, y)
    draw_actor_name(actor, x, y)
    draw_actor_level(actor, x, y + line_height * 1)
    draw_actor_icons(actor, x, y + line_height * 2)
    draw_actor_class(actor, x + 152, y)
    draw_actor_hp(actor, x + 152, y + line_height * 1)
    draw_actor_mp(actor, x + 152, y + line_height * 2)
  end
  #--------------------------------------------------------------------------
  # ● 能力値の描画
  #--------------------------------------------------------------------------
  def draw_actor_param(actor, x, y, param_id)
    change_color(system_color)
    draw_text(x, y, 152, line_height, Vocab::param(param_id))
    change_color(normal_color)
    draw_text(x + 152, y, 36, line_height, actor.param(param_id), 2)
  end
  #--------------------------------------------------------------------------
  # ● アイテム名の描画
  #     enabled : 有効フラグ。false のとき半透明で描画
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y, enabled = true, width = 236)
    draw_item_name_vga(item, x, y, enabled, width)
  end
  
end

#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
#  ステータス画面で表示する、フル仕様のステータスウィンドウです。
#==============================================================================

class Window_Status < Window_Selectable
  
  #--------------------------------------------------------------------------
  # ● ブロック 1 の描画
  #--------------------------------------------------------------------------
  def draw_block1(y)
    draw_actor_name(@actor, 4, y)
    draw_actor_class(@actor, 128, y)
    draw_actor_nickname(@actor, 336, y)
  end
  #--------------------------------------------------------------------------
  # ● ブロック 2 の描画
  #--------------------------------------------------------------------------
  def draw_block2(y)
    draw_actor_face(@actor, 8, y)
    draw_basic_info(136, y)
    draw_exp_info(336, y)
  end
  #--------------------------------------------------------------------------
  # ● ブロック 3 の描画
  #--------------------------------------------------------------------------
  def draw_block3(y)
    draw_parameters(32, y)
    draw_equipments(336, y)
  end
  #--------------------------------------------------------------------------
  # ● 経験値情報の描画
  #--------------------------------------------------------------------------
  def draw_exp_info(x, y)
    s1 = @actor.max_level? ? "-------" : @actor.exp
    s2 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp
    s_next = sprintf(Vocab::ExpNext, Vocab::level)
    change_color(system_color)
    draw_text(x, y + line_height * 0, 180, line_height, Vocab::ExpTotal)
    draw_text(x, y + line_height * 2, 180, line_height, s_next)
    change_color(normal_color)
    draw_text(x, y + line_height * 1, 180, line_height, s1, 2)
    draw_text(x, y + line_height * 3, 180, line_height, s2, 2)
  end
  
end

#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
#  バトル画面で、パーティメンバーのステータスを表示するウィンドウです。
#==============================================================================

class Window_BattleStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # ● ゲージエリアの幅を取得
  #--------------------------------------------------------------------------
  def gauge_area_width
    return 284
  end
  #--------------------------------------------------------------------------
  # ● ゲージエリアの描画(TP あり)
  #--------------------------------------------------------------------------
  def draw_gauge_area_with_tp(rect, actor)
    draw_actor_hp(actor, rect.x + 0, rect.y, 136)
    draw_actor_mp(actor, rect.x + 146, rect.y, 64)
    draw_actor_tp(actor, rect.x + 220, rect.y, 64)
  end
  #--------------------------------------------------------------------------
  # ● ゲージエリアの描画(TP なし)
  #--------------------------------------------------------------------------
  def draw_gauge_area_without_tp(rect, actor)
    draw_actor_hp(actor, rect.x + 0, rect.y, 166)
    draw_actor_mp(actor, rect.x + 176,  rect.y, 108)
  end
end
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
566
在线时间
46 小时
注册时间
2017-10-23
帖子
14
7
发表于 2019-4-12 16:08:38 | 只看该作者
sezhiyang 发表于 2019-4-3 09:49
在676行改分辨率,现在是800.600,兼容性最好

原来14年就有不修改DLL扩大的了,但是还是不能按ALT+ENTER全屏
我是很喜欢全屏玩游戏的(沉浸感)
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1422
在线时间
245 小时
注册时间
2019-1-18
帖子
190
8
发表于 2023-7-30 19:24:24 | 只看该作者
sezhiyang 发表于 2019-4-3 09:49
在676行改分辨率,现在是800.600,兼容性最好

第678行报错了,说是无效的指令“_end_"
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
130
在线时间
63 小时
注册时间
2021-4-23
帖子
24
9
发表于 2023-8-3 07:23:33 | 只看该作者
————id——
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-30 02:04

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表