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

Project1

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

[有事请教] 游戏界面太小了,如何扩大一点

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1239
在线时间
75 小时
注册时间
2020-6-20
帖子
60
跳转到指定楼层
1
发表于 2023-11-26 09:38:41 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
新手入坑,请指教
游戏界面太小了,如何扩大一点,同题

Lv4.逐梦者

梦石
0
星屑
5680
在线时间
782 小时
注册时间
2019-1-20
帖子
191
2
发表于 2023-11-26 12:08:28 | 只看该作者
使用论坛的搜索功能
只是觉得东西小,搜索 放大 之类
觉得可视范围小,搜索 分辨率 之类
注意是否通用的版本或者是va的版本

提高解答机会的方法:
看一下对应版本的帮助文件 看天气预报说今天不下雨
改变问题为更有可能的或常见的 如:天气自动变化下雨→天气系统 果然不准呀~
使用论坛的搜索功能查找相关问题 好丧啊... ...想看女装
清楚说明实际上你想解决的问题  想看坛友的女装  
脚本自己有改过的地方要标明  不要遮脸的
脚本有问题但不是默认的要全部贴出来 大胆点,尽情发
三包原则:包有BUG,包甩锅,包咕咕
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
10673
在线时间
908 小时
注册时间
2019-11-5
帖子
2225

极短24参与

3
发表于 2023-11-26 12:17:28 | 只看该作者
本帖最后由 哇哇哇啊叭叭 于 2024-2-15 15:52 编辑

  

楼下好人,转一下他的答案,不过在此之前,分享一个其他办法:
1. 在RM里,按下F11,进入脚本编辑器。
2. 找到最左侧最后一行“Main”条目,并点击它。
3. 在右边窗口里,“rgss_main { SceneManager.run }”的上面添加“Graphics.resize_screen(640,480)”字段。点击应用即可。

  但需注意,无论使用哪个脚本,地图格数最小尺寸不能小于窗口分辨率/32。跟其他脚本发生冲突的可能性也增加了。我并不懂脚本,只做脚本的搬运工。(鞠躬,鞠躬)




  坛内搜索“分辨率”。或者到VA图书馆去找找,应该有更改窗口大小、分辨率的方法。
  但这些脚本大多有问题:使用类似脚本后,常有窗口卷动、地图显示一类的bug。
  或者与其他脚本产生一些结合性的问题,比如当地图格数过小,且使用了一些脚本(如寻路+鼠标)后,再使用分辨率脚本可能会导致寻路和鼠标部分功能失效。

  建议随方就圆。在VA默许的窗口大小下设计游戏。
  如果将va默认给出的功能分为【基本功能】和【附加功能】,前者是在做游戏时,需要大量修改代码,或是修改后对游戏影响较多的功能(如分辨率、Sprite类等等);后者是只需少量修改,或修改后对游戏影响较小的功能。建议不要修改前者,可以适当修改后者。
  主要原因是【工量】。可以把va看成一份由学霸做了9成的数学作业,游戏设计者可以只做剩下的10%就行了,这样错题少、做的快;但若想添加些与VA原功能差距较大的功能,就像拿着学霸给的数学作业,却想给老师交上语文作业,那还不如重写作业(更换游戏引擎)。

  
风继续吹,不忍远离。年少轻狂,眼神明亮,最好的年纪,最好的时光。希望岁月是一场春梦
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
796
在线时间
72 小时
注册时间
2023-12-26
帖子
105
4
发表于 2024-2-15 13:35:58 | 只看该作者
#=============================================================================
# Σ Fullscreen
#-----------------------------------------------------------------------------
# @author  : Gabriel "Gab!" Teles
# @date    : 2014-09-27
# @version : 0.9.2
#-----------------------------------------------------------------------------
# TODO:
#   - Transições por imagens
#-----------------------------------------------------------------------------
# Créditos:
#   Scripter Desconhecido no Pastebin (http://pastebin.com/sM2MNJZj)
#   Esrever : Map viewport/scroll fix
#   Zeus81  : FPS Display
#-----------------------------------------------------------------------------
# Permite utilizar fullscreen real (sem redimensionamento de tela), e alterar
# o limite da função Graphics.resize_screen para a resolução máxima do monitor
# ou um valor próximo.
#=============================================================================

# Módulo Graphics
class << Graphics
  # API
  User32   = DL.dlopen('user32')
  Kernel32 = DL.dlopen('kernel32')
  GetActiveWindow  = DL::CFunc.new(  User32['GetActiveWindow' ], DL::TYPE_LONG)
  GetSystemMetrics = DL::CFunc.new(  User32['GetSystemMetrics'], DL::TYPE_LONG)
  GetWindowRect    = DL::CFunc.new(  User32['GetWindowRect'   ], DL::TYPE_LONG)
  SetWindowLong    = DL::CFunc.new(  User32['SetWindowLong'   ], DL::TYPE_LONG)
  SetWindowPos     = DL::CFunc.new(  User32['SetWindowPos'    ], DL::TYPE_LONG)
  GetModuleHandle  = DL::CFunc.new(Kernel32['GetModuleHandle' ], DL::TYPE_LONG)  

  # DLL sendo utilizada
  _DLLName = DL::CPtr.malloc(140)
  s = DL::CFunc.new(Kernel32['GetPrivateProfileString'], DL::TYPE_LONG).call([
    DL::CPtr["Game"].to_i,
    DL::CPtr["Library"].to_i,
    0,
    _DLLName.to_i,
    140,
    DL::CPtr["./Game.ini"].to_i
  ])

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

  # Verifica se é uma RGSS3xx.dll
  if @@DLLName.match(/^RGSS3(\d{2})\.dll$/)
    @@DLLVersion = $1.to_i
   
    # Verifica se a versão é 0 ou 1.
    if @@DLLVersion.between?(0, 1)
      # Flag de fullscreen
      @@inFullscreen = false
     
      # Instância da DLL. *Necessariamente* a RGSS300.dll ou RGSS301.dll, visto
      # que o trabalho com memória a seguir é específico.
     
      @@DLLHandle   = GetModuleHandle.call([DL::CPtr[@@DLLName].to_i])
     
      # Instância da janela de jogo
      @@hWnd       = GetActiveWindow.call([])
     
      # Tamanho da tela
      @@screenSize = [
        GetSystemMetrics.call([0]),
        GetSystemMetrics.call([1])
      ]
     
      # Calcula o próximo tamanho divisível por 32 para fazer a limitação
      width, height = @@screenSize
      width  += (32 - (width  % 32)) unless (width  % 32).zero?
      height += (32 - (height % 32)) unless (height % 32).zero?
      puts "Limitando para: #{width}x#{height}" if $TEST
     
      #-----------------------------------------------------------------------
      # Bruxaria de scripter desconhecido. Remove a limitação de tamanho para
      # o método Graphics.resize_screen (640x480)
      #
      # Base retirada de: http://pastebin.com/sM2MNJZj
      #
      # Adaptações para a RGSS300.dll e início do mapeamento dos endereços
      # utilizados por Gab!
      #-----------------------------------------------------------------------
     
      # Número para string
      wh = ->(w, h, off = 0){
        [w + off, h + off].pack('l2').scan(/..../)
      }
     
      # Altera um valor na memória relativa à DLL
      mod = ->(adr, val){
        adr += @@OFF if @@DLLVersion.zero?
        DL::CPtr.new(@@DLLHandle + adr)[0, val.size] = val
      }
     
      # Valores úteis
      wt,  ht  = width.divmod(32), height.divmod(32)
      w,   h   = wh.(width, height)
      ww,  hh  = wh.(width, height, 32)
      www, hhh = wh.(wt.first, ht.first, 1)
      zero     = [0].pack('l')
         
      # Faz as alterações na memória
     
      # Graphics
      @@OFF = 0
      mod.(0x195F, "\x90"*5) # ???
      mod.(0x19A4,   h     ) # ???
      mod.(0x19A9,   w     ) # ???
      mod.(0x1A56,   h     ) # ???
      mod.(0x1A5B,   w     ) # ???
      mod.(0x20F6,   w     ) # Max width  (?)
      mod.(0x20FF,   w     ) # Max width  (?)
      mod.(0x2106,   h     ) # Max height (?)
      mod.(0x210F,   h     ) # Max height (?)
     
      # Plane (?) Class
      @@OFF   = -0xC0
      Graphics::PlaneSpeedUp = true
        # Setando para false não é necessário reescrever classe Plane. No
        # entanto, o mapa fica MUITO lento.
      mod.(0x1C5E3,  Graphics::PlaneSpeedUp ? zero : h) # Max height
      mod.(0x1C5E8,  Graphics::PlaneSpeedUp ? zero : w) # Max width
     
      # ???
      @@OFF = 0x20
      mod.(0x1F477,  h     ) # ???
      mod.(0x1F47C,  w     ) # ???
     
      # Tilemap Class
      @@OFF = 0x1E0
      mod.(0x211FF,  hh    ) # Tilemap render height
      mod.(0x21204,  ww    ) # Tilemap render width
      mod.(0x21D7D,  hhh[0]) # Tilemap max tiles on screen height
      mod.(0x21E01,  www[0]) # Tilemap max tiles on screen width
     
      # ???
      @@OFF = 0x140
      mod.(0x10DEA8, h     ) # ???
      mod.(0x10DEAD, w     ) # ???   
      mod.(0x10DEDF, h     ) # ???
      mod.(0x10DEE3, w     ) # ???
      mod.(0x10DF14, h     ) # ???
      mod.(0x10DF18, w     ) # ???
      mod.(0x10DF48, h     ) # ???
      mod.(0x10DF4C, w     ) # ???
      mod.(0x10E6A7, w     ) # ???
      mod.(0x10E6C3, h     ) # ???
      mod.(0x10EEA9, w     ) # ???
      mod.(0x10EEB9, h     ) # ???
     
      #-------------------------------------------------------------------------
      # Fim da bruxaria
      #-------------------------------------------------------------------------
     
      # Sprite de transição de tela
      @@TransitionSprite = Sprite.new
      @@TransitionSprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
      @@TransitionSprite.bitmap.fill_rect(@@TransitionSprite.bitmap.rect, Color.new(0, 0, 0))
      @@TransitionSprite.opacity = 0
      @@TransitionSprite.z = 0x7FFFFFFF
     
      # Bitmap da tela no momento do Graphics.freeze
      @@FrozenBitmap = Bitmap.new(Graphics.width, Graphics.height)
      @@FrozenBitmap.fill_rect(@@FrozenBitmap.rect, Color.new(0, 0, 0))
     
      # Realiza a transição de tela
      # Nota: Não é possível realizar transição de tela com imagens
      alias oldFullscreenResTransition transition
      def transition(time, image='', vague=40)
        @@TransitionSprite.bitmap.dispose
        @@TransitionSprite.dispose
        @@TransitionSprite = Sprite.new
        @@TransitionSprite.bitmap = @@FrozenBitmap
        @@TransitionSprite.opacity = 255
        @@TransitionSprite.z = 0x7FFFFFFF
     
        oldFullscreenResTransition(0)
      
        dec = (255.0 / time)
        time.times {
          @@TransitionSprite.opacity -= dec
          Graphics.update
        }
      end
     
      # Fadein
      def fadein(time)
        @@FrozenBitmap = Bitmap.new(Graphics.width, Graphics.height)
        @@FrozenBitmap.fill_rect(@@FrozenBitmap.rect, Color.new(0, 0, 0))
      
        transition(time)
      end
     
      # Fadeout
      def fadeout(time)
        inc = (255.0 / time)
        time.times {
          @@TransitionSprite.opacity += inc
          Graphics.update
        }
      end
     
      # Armazena a imagem da tela
      alias oldFullscreenResFreeze freeze
      def freeze(*a, &b)
        oldFullscreenResFreeze(*a, &b)
        @@FrozenBitmap = Graphics.snap_to_bitmap
      end
     
      # Realiza o redimensionamento de tela
      alias gabFullscreenOldResizeScreen resize_screen
      def resize_screen(*a, &b)
        # Redimensiona normalmente
        gabFullscreenOldResizeScreen(*a, &b)
        # Redimensiona o sprite de transição
        @@TransitionSprite.bitmap.dispose
        @@TransitionSprite.bitmap = Bitmap.new(*Graphics.size)
        @@TransitionSprite.bitmap.fill_rect(@@TransitionSprite.bitmap.rect, Color.new(0, 0, 0))
      
        if Graphics::PlaneSpeedUp
          # Manda o sinal de atualização para todas as instâncias da classe Plane
          ObjectSpace.each_object(Plane){|plane|
            plane.send(:recreateBitmap)
          }
        end
      end
     
      # Altera para fullscreen
      def fullscreen
        # Retorna se já estiver em fullscreen
        return if @@inFullscreen
        # Tamanho antes do fullscreen
        rect = DL::CPtr.malloc(16)
        rect[0, 16] = 0.chr * 16
        GetWindowRect.call([@@hWnd, rect])
        @@windowSize = rect[0, 16].unpack("l*")
        @@windowSize[2] -= @@windowSize[0]
        @@windowSize[3] -= @@windowSize[1]
        @@windowResolution = Graphics.size
        # Muda o tamanho da tela
        Graphics.resize_screen(*@@screenSize)
        # Remover bordas da janela
        SetWindowLong.call([@@hWnd, -16, 0x14000000])
        # Coloca a janela acima de todas as outras
        SetWindowPos.call([@@hWnd, -1, 0, 0, *@@screenSize, 0])
        # Modifica a flag de fullscreen
        @@inFullscreen = true
        # Espera alguns frames para terminar o processamento
        Graphics.wait(5)
      end
     
      # Altera para modo janela
      def windowed
        # Retorna se não estiver em fullscreen
        return unless @@inFullscreen
        # Muda o tamanho da tela
        Graphics.resize_screen(*@@windowResolution)
        # Recoloca bordas da janela
        SetWindowLong.call([@@hWnd, -16, 0x14CA0000])
        # Coloca a janela na posição x,y,z comum e ajusta seu tamanho
        SetWindowPos.call([@@hWnd, 0, *@@windowSize, 0])
        # Modifica a flag de fullscreen
        @@inFullscreen = false
        # Espera alguns frames para terminar o processamento
        Graphics.wait(5)
      end
     
      # Tamanho da tela
      def size
        [self.width, self.height]
      end
     
      # Verifica se a janela está no modo fullscreen
      def fullscreen?
        return @@inFullscreen
      end
     
      # Verifica se a janela está no modo janela
      def windowed?
        return !@@inFullscreen
      end
     
      # Alterna entre os modos fullscreen e janela
      def toggleFullscreen
        @@inFullscreen ? self.windowed : self.fullscreen
      end
    end
  end
end

if Graphics::PlaneSpeedUp
  # Remove a classe Plane Anterior
  Object.send(:remove_const, :Plane)
  # Redefinição da classe Plane
  class Plane
    attr_reader :viewport
    attr_reader :bitmap
    attr_reader :ox
    attr_reader :oy
    attr_reader :opacity
    attr_reader :blend_type
    attr_reader :color
    attr_reader :tone
    attr_reader :visible
    attr_reader :zoom_x
    attr_reader :zoom_y
    attr_reader :z
   
    # Inicialização do objeto
    def initialize(viewport = nil)
      # É necessário verificar se um viewport foi enviado. Desse modo, ao mudar a
      # resolução da tela, deve-se mudar também a rect do viewport para que o
      # Plane que ocupava a tela toda continue
      @defaultViewport = !viewport.is_a?(Viewport)
      @viewport = @defaultViewport ? Viewport.new(0, 0, *Graphics.size) : viewport
     
      @sprite        = Sprite.new(@viewport)
      @bitmap        = nil
      @ox            = @sprite.ox         # 0
      @oy            = @sprite.oy         # 0
      @opacity       = @sprite.opacity    # 255
      @blend_type    = @sprite.blend_type # 0
      @color         = @sprite.color      # Color.new(0, 0, 0, 0)
      @tone          = @sprite.tone       # Tone.new(0, 0, 0, 0)
      @visible       = @sprite.visible    # true
      @z             = @sprite.z          # 0
      @zoom_x        = @sprite.zoom_x     # 1.0
      @zoom_y        = @sprite.zoom_y     # 1.0
    end
   
    def bitmap=(bitmap)
      return unless bitmap.is_a?(Bitmap)
      @bitmap = bitmap
      self.recreateBitmap(true)
    end
   
    def ox=(value)
      @ox = value
      return unless @bitmap
      @sprite.ox = (value % @bitmap.width)
    end
   
    def oy=(value)
      @oy = value
      return unless @bitmap
      @sprite.oy = (value % @bitmap.height)
    end
   
    def opacity=(value)
      @sprite.opacity = value
      @opacity = @sprite.opacity
    end
   
    def blend_type=(value)
      @sprite.blend_type = value
      @blend_type = @sprite.blend_type
    end
   
    def color=(value)
      @sprite.color = value
      @color = @sprite.color
    end
   
    def tone=(value)
      @sprite.tone = value
      @tone = @sprite.tone
    end
   
    def viewport=(value)
      @defaultViewport &= (value == @sprite.viewport)
      @sprite.viewport = value
      @viewport = @sprite.viewport
    end
   
    def visible=(value)
      @sprite.visible = value
      @visible = sprite.visible
    end
   
    def z=(value)
      @sprite.z = value
      @z = @sprite.z
    end
   
    def zoom_x=(value)
      @sprite.zoom_x = value
      @zoom_x = @sprite.zoom_x
      self.recreateBitmap
    end
   
    def zoom_y=(value)
      @sprite.zoom_y = value
      @zoom_y = @sprite.zoom_y
      self.recreateBitmap
    end
   
    def disposed?
      return @sprite.disposed?
    end
   
    def dispose
      @sprite.dispose
    end
   
    protected
   
    def recreateBitmap(forceRefresh = false)
      cw, ch      = Graphics.width * (2.0/@zoom_x), Graphics.height * (2.0/@zoom_y)
      needRefresh = true
     
      if @defaultViewport
        @viewport.rect.width, @viewport.rect.height = *Graphics.size
      end
     
      if @sprite.bitmap.nil? or @sprite.bitmap.disposed?
        newBitmap = Bitmap.new(cw, ch)
      else
        if (cw == @sprite.bitmap.width) and (ch == @sprite.bitmap.height) and (!forceRefresh)
          return
        end
      
        newBitmap = Bitmap.new(cw, ch)
        if (cw < @sprite.bitmap.width) and (ch < @sprite.bitmap.height)
          newBitmap.blt(0, 0, @sprite.bitmap, @sprite.bitmap.rect)
          @sprite.bitmap.dispose
          needRefresh = false
        end
      end
     
      @sprite.bitmap = newBitmap
      self.refreshBitmap if needRefresh or forceRefresh
    end
   
    def refreshBitmap
      # Limpa o bitmap
      b = @sprite.bitmap
      b.clear
     
      return if @bitmap.nil?
     
      # Quantia de espaços para blt
      tx = (b.width  / @bitmap.width.to_f )
      ty = (b.height / @bitmap.height.to_f)
     
      b.blt(0, 0, @bitmap, @bitmap.rect)
     
      return if tx + ty == 2
     
      # Preenche 1 linha
      basePow = @bitmap.width
      baseRct = Rect.new(0, 0, @bitmap.width, @bitmap.height)
     
      Math.log2(tx).floor.times{
        b.blt(basePow, 0, b, baseRct)
        baseRct.width += basePow
        basePow *= 2
      }
     
      # Último bitmap da linha
      baseRct.width = (b.width - baseRct.width)
      b.blt(basePow, 0, b, baseRct)
     
      # Preenche o restante das linhas
      basePow = @bitmap.height
      baseRct = Rect.new(0, 0, b.width, @bitmap.height)
     
      Math.log2(ty).floor.times{
        b.blt(0, basePow, b, baseRct)
        baseRct.height += basePow
        basePow *= 2
      }
     
      # Última linha
      baseRct.height = b.height - baseRct.height
      b.blt(basePow, 0, b, baseRct)
    end
  end
end

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

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

# Contador de FPS para o modo Fullscreen
if $TEST
  # FPS Display // Zeus81
  # http://forums.rpgmakerweb.com/in ... ccurate/#entry40350
  module Graphics
    @fps, @fps_tmp = 0, []
   
    class << self
      attr_reader :fps
     
      alias fps_update update unless method_defined?(:fps_update)
      def update
        t = Time.now
        fps_update
        @fps_tmp[frame_count % frame_rate] = Time.now != t
        @fps = 0
        frame_rate.times {|i| @fps += 1 if @fps_tmp}
        fps_sprite.src_rect.y = @fps * 16
      end
     
      def fps_sprite
        if !@fps_sprite or @fps_sprite.disposed?
          @fps_sprite = Sprite.new
          @fps_sprite.z = 0x7FFFFFFF
          @fps_sprite.bitmap = Bitmap.new(24, 16*120)
          @fps_sprite.bitmap.font.name = "Arial"
          @fps_sprite.bitmap.font.size = 16
          @fps_sprite.bitmap.font.color.set(255, 255, 255)
          @fps_sprite.bitmap.fill_rect(@fps_sprite.bitmap.rect, Color.new(0, 0, 0, 127))
          120.times {|i|
            @fps_sprite.bitmap.draw_text(0, i*16, 24, 16, "% 3d"%i, 1)
          }
          @fps_sprite.src_rect.height = 16
        end
        return @fps_sprite
      end      
    end
  end
end

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

#==============================================================================
# ■ Game_Map
#==============================================================================

class Game_Map

  #--------------------------------------------------------------------------
  # overwrite method: scroll_down
  #--------------------------------------------------------------------------
  def scroll_down(distance)
    if loop_vertical?
      @display_y += distance
      @display_y %= @map.height * 256
      @parallax_y += distance
    else
      last_y = @display_y
      dh = Graphics.height > height * 32 ? height : screen_tile_y
      @display_y = [@display_y + distance, height - dh].min
      @parallax_y += @display_y - last_y
    end
  end

  #--------------------------------------------------------------------------
  # overwrite method: scroll_right
  #--------------------------------------------------------------------------
  def scroll_right(distance)
    if loop_horizontal?
      @display_x += distance
      @display_x %= @map.width * 256
      @parallax_x += distance
    else
      last_x = @display_x
      dw = Graphics.width > width * 32 ? width : screen_tile_x
      @display_x = [@display_x + distance, width - dw].min
      @parallax_x += @display_x - last_x
    end
  end

end # Game_Map

#==============================================================================
# ■ Spriteset_Map
#==============================================================================

class Spriteset_Map

  #--------------------------------------------------------------------------
  # overwrite method: create_viewports
  #--------------------------------------------------------------------------
  def create_viewports
    if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?
      dx = (Graphics.width - $game_map.width * 32) / 2
    else
      dx = 0
    end
    dw = [Graphics.width, $game_map.width * 32].min
    dw = Graphics.width if $game_map.loop_horizontal?
    if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?
      dy = (Graphics.height - $game_map.height * 32) / 2
    else
      dy = 0
    end
    dh = [Graphics.height, $game_map.height * 32].min
    dh = Graphics.height if $game_map.loop_vertical?
    @viewport1 = Viewport.new(dx, dy, dw, dh)
    @viewport2 = Viewport.new(dx, dy, dw, dh)
    @viewport3 = Viewport.new(dx, dy, dw, dh)
    @viewport2.z = 50
    @viewport3.z = 100
  end

  #--------------------------------------------------------------------------
  # new method: update_viewport_sizes
  #--------------------------------------------------------------------------
  def update_viewport_sizes
    if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal?
      dx = (Graphics.width - $game_map.width * 32) / 2
    else
      dx = 0
    end
    dw = [Graphics.width, $game_map.width * 32].min
    dw = Graphics.width if $game_map.loop_horizontal?
    if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical?
      dy = (Graphics.height - $game_map.height * 32) / 2
    else
      dy = 0
    end
    dh = [Graphics.height, $game_map.height * 32].min
    dh = Graphics.height if $game_map.loop_vertical?
    rect = Rect.new(dx, dy, dw, dh)
    for viewport in [@viewport1, @viewport2, @viewport3]
      viewport.rect = rect
    end
  end

end # Spriteset_Map

#==============================================================================
# ■ Scene_Map
#==============================================================================

class Scene_Map < Scene_Base

  #--------------------------------------------------------------------------
  # alias method: post_transfer
  #--------------------------------------------------------------------------
  alias scene_map_post_transfer_ace post_transfer
  def post_transfer
    @spriteset.update_viewport_sizes
    scene_map_post_transfer_ace
  end

end # Scene_Map

#==============================================================================
# ■ Game_Event
#==============================================================================

class Game_Event < Game_Character

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

end # Game_Event

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

__END__
# TESTES
# Graphics.windowed
x = Bitmap.new(50, 50)
x.gradient_fill_rect(0,  0, 50, 25, Color.new(255, 0, 0), Color.new(0, 255, 0))
x.gradient_fill_rect(0, 25, 50, 25, Color.new(0, 255, 0), Color.new(0, 0, 255))
y = Plane.new
y.bitmap = x
y.zoom_x = 3
y.zoom_y = 3
#Graphics.fullscreen
#Graphics.windowed
loop do
  Graphics.update
  y.ox += 1
  y.oy += 1
end
回复 支持 1 反对 0

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-28 22:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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